Last active
May 22, 2021 19:22
-
-
Save frankyonnetti/5944784 to your computer and use it in GitHub Desktop.
Drupal 7 - print content type fields #drupal #d7
This file contains hidden or 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
| // default field output | |
| <?php print render($content['field_EXAMPLE']); ?> | |
| <?php print render($content['body']); ?> | |
| // striped output only | |
| <?php print render($content['field_EXAMPLE']['und'][0]['value']); ?> | |
| <?php print render($content['field_EXAMPLE']['und'][0]['url']); ?> | |
| <?php print render($content['field_EXAMPLE']['und'][0]['email']); ?> | |
| // make sure field isn't empty | |
| <?php $highest_degree = field_get_items('node', $node, 'field_highest_degree'); ?> | |
| <?php if($highest_degree): ?> | |
| <?php print render($content['field_highest_degree']); ?> | |
| <?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment