开发者

How to access node fields in template_preprocess_node(Drupal 7)

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜