Tag: preprocess

Drupal: Check and render image fields

At reclaimyourcity, we have picture and artist nodes and relate them via a node reference. Now some of the artists may have a little profile comprising a picture and a description. When viewing the artist profile and there is no profile picture yet, we want to show the latest submitted picture of the particular artist instead. For this, we first need to check the value of the profile picture field and if it is not set, we need to get and render the latest picture of the artist. The first question is where to perform this check. Fortunately, Drupal offers

Posted in code Tagged with: , , , , , , ,