Drupal 7 fields: Unterschied zwischen den Versionen
Erscheinungsbild
Keine Bearbeitungszusammenfassung |
Keine Bearbeitungszusammenfassung |
||
| Zeile 1: | Zeile 1: | ||
==Fields für node.tpl.php== | ==Fields für node.tpl.php== | ||
http://api.drupal.org/api/drupal/modules!field!theme!field.tpl.php/7 | http://api.drupal.org/api/drupal/modules!field!theme!field.tpl.php/7 | ||
Content | * Content | ||
<?php | <?php | ||
hide($content['title']); | hide($content['title']); | ||
hide($content); | hide($content); | ||
?> | ?> | ||
Caption | * Caption | ||
<?php | <?php | ||
print render($content['field_news_caption1']); | print render($content['field_news_caption1']); | ||
?> | ?> | ||
Field | * Field | ||
<?php | <?php | ||
print render($content['field_address1']); | print render($content['field_address1']); | ||
?> | ?> | ||
Title | * Title | ||
<?php | <?php | ||
print render($content['title']); | print render($content['title']); | ||
?> | ?> | ||
Body | * Body | ||
<?php | <?php | ||
print render($content['body']); | print render($content['body']); | ||
?> | ?> | ||
Images | * Images im Node anzeigen | ||
<?php | <?php | ||
$my_image = array( | $my_image = array( | ||
Version vom 13. November 2012, 12:53 Uhr
Fields für node.tpl.php
http://api.drupal.org/api/drupal/modules!field!theme!field.tpl.php/7
- Content
<?php
hide($content['title']);
hide($content);
?>
- Caption
<?php print render($content['field_news_caption1']); ?>
- Field
<?php print render($content['field_address1']); ?>
- Title
<?php print render($content['title']); ?>
- Body
<?php print render($content['body']); ?>
- Images im Node anzeigen
<?php
$my_image = array(
'style_name' => 'thumbnail', //the image style created
'path' => $node->field_flyin_portrait['und'][0]['uri'],
);
print theme('image_style', $my_image); ?>
Fields Templete field--field_bilder.tpl.php
Datei erstelln, wie das Field heisst. zB. field--field_fieldname.tpl.php das Beispliel ist für deine Bildergalerie gedacht.
<?php
foreach ($items as $delta => $item) :
print render($item);
endforeach;
?>