开发者

Display a nodes fields using a custom page display template in Drupal 7

开发者 https://www.devze.com 2023-03-20 14:44 出处:网络
I have the custom page diplay template working page-开发者_如何转开发-press.tpl.php however I cant seem to access the nodes field data.

I have the custom page diplay template working page-开发者_如何转开发-press.tpl.php however I cant seem to access the nodes field data.

This does not work

field_pr_link[$noderr->language][0]['value']; print($noderr); ?>

however I can print_r $node just fine and see my field data I just cant get to it.


Install Drupal's Devel module and use it to print the $node object to see what other information you have access to. Once devel is installed, insert dpm($node) in your code to print out the node and you'll see what you can access in the node.

http://blog.anselmbradford.com/2009/03/14/2-invaluable-drupal-development-tips-list-all-available-variables-and-backtrace-a-page/ has some illustrations of what the devel print out on the page would look like.

0

精彩评论

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