Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I would like to have a static ,small custom icon(default/files/fruits.png) to be displayed to the left of the cck field output in the body of a content type.
For eg ,for a cck field called 'Fruits I love' and the user entered 'orange' the icon, fruits(default/files/fruits.png) should be displayed to the left of orange in the ouput node.
Sorry,Am ignorant of php.Please explain where in the following code i should insert the call to this image and how.
The code used for body of content teplate of a content type is
<?php print $node->content['body']['#value'] ?><table>
<tr>
<td>
<?php print $node->field_image[0]['view'] ?>
</td>
<td>
<?php print $node->field_image[1]['view'] ?>
</td>
<td>
<?php print $node->field_mnemonic_article[0]['view'] ?>
</td>
</tr>
</table>
Comment | File | Size | Author |
---|---|---|---|
#1 | cck_icon.JPG | 21.73 KB | nirvanajyothi |
Comments
Comment #1
nirvanajyothi CreditAttribution: nirvanajyothi commentedboth field_image and field_mnemonic_article are link fields...and to be specific i would like to display 2 different icons ,one to the left of field_image and ,one to the left of field_mnemonic_article (ie.to the left of 'Show image'and 'Read related article' of the screenshot)
A screen shot of how these fields are displayed now in the node is attached.
-thank you.Any help be deeply appreciated...