Last active
June 30, 2016 05:01
-
-
Save drfeld/67e478a3e88fd9a9b612 to your computer and use it in GitHub Desktop.
Drupal: Render a picture mapping programmatically
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$picture = field_view_field('node', $node, '[IMAGE FIELD MACHINE NAME GOES HERE]', array( | |
'label' => 'hidden', | |
'type' => 'picture', | |
'settings' => array( | |
'picture_group' => '[PICTURE MAPPING MACHINE NAME GOES HERE]', | |
'fallback_image_style' => '[IMAGE STYLE MACHINE NAME GOES HERE]', | |
'image_link' =>''))); | |
print "<a href='/" . drupal_get_path_alias("node/" . $node->nid) . "'>" . render($picture) . "</a>"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment