Finding the field attributes for a node

Using the Devel module

The best option is to use the Devel module. With this you can find out this information by going to your node and then selecting 'Development > Field Info' (/devel/field/info). This will give you a nicely formatted and navigatable Krumo rendered break down of all the associated field properties.

Alternatively you could use the below PHP code:

<?php dpm($node); ?>

With plain PHP

If you don't want to use the Devel module for any reason, add this code to your node.tpl.php template file. It will print out the full structure of your page with all available variables.

<?php print_r($node); ?>

The above isn't very readable, but you can use the below to print it out all nicely formatted.

<?php drupal_set_message('<pre>'. print_r($node, TRUE) .'</pre>'); ?>



Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.