Charlie
Charlie

Reputation: 99

how do i customize the look of a Drupal 7 Node?

I have created an Article in Drupal 7 and I want to customize how the content is displayed.

I am trying to modify the node.tpl.php, which gives you access to the $content variable, but this is a multidimensional array and I cannot extract the keys or values within it.

Is there a way of seeing inside $content to find out the exact value pairs that I need?

Or is there another way of customizing the display and output of Drupal 7 content?

Upvotes: 2

Views: 350

Answers (1)

Finbarr
Finbarr

Reputation: 32126

If you install the and enable the devel module, it gives you access to a very handy function dsm that will render a widget that lets you explore the contents of any variable or object. So in your node.tpl.php file: dsm($content); at the top will let you inspect the content. Usually you will want to create a custom node-type.tpl.php file e.g. node-article.tpl.php which is only applied to nodes of a certain type.

Upvotes: 1

Related Questions