0

I edit my template field--field-email--customer.tpl.php and it works but I would like to display a field twice. I tried with this but it doesn't work : print render($content['field_nom']);

  • You need to correct the question. Your question title is a about content type template and description is about field template. You wants to display field in content type template or field template ( field--field-email--customer.tpl.php). – DRUPWAY Aug 30 '16 at 8:34
0

As per my knowledge you can not use $content array in field.tpl.php. You need to use $items.

Available variables:

$items: An array of field values. Use render() to output them.
$label: The item label.
$label_hidden: Whether the label display is set to 'hidden'.
$classes: String of classes that can be used to style contextually through CSS.

from preprocess functions. The default values can be one or more of the following:

field: The current template type, i.e., "theming hook".
field-name-[field_name]: The current field name.
field-type-[field_type]: The current field type. 
field-label-[label_display]: The current label position. 
$element['#object']: The entity to which the field is attached.
$element['#view_mode']: View mode, e.g. 'full', 'teaser'...
$element['#field_name']: The field name.
$element['#field_type']: The field type.
$element['#field_language']: The field language.
$element['#field_translatable']: Whether the field is translatable or not.
$element['#label_display']: Position of label display, inline, above, or hidden.
$field_name_css: The css-compatible field name.
$field_type_css: The css-compatible field type.
$classes_array: Array of html class attribute values
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.