开发者

How to access node fields in template_preprocess_node(Drupal 7)

开发者 https://www.devze.com 2023-03-09 08:18 出处:网络
I want to access a node field in template_preprocess_node.My site is multilingual and the form of the field in node array is something like

I want to access a node field in template_preprocess_node.My site is multilingual and the form of the field in node array is something like

$node->fi开发者_运维技巧eld_my_field['en'][0]['value'].

Is there another way to access the value of this field?Because with this way I should specify the user language.(I want just field value not the value with it's label)


use the field_get_items function.

This is the best way to get field items, don't reference them directly with a fixed language.

0

精彩评论

暂无评论...
验证码 换一张
取 消