user845040
user845040

Reputation: 59

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

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.

Upvotes: 1

Views: 996

Answers (1)

nmc
nmc

Reputation: 8686

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.

Upvotes: 1

Related Questions