Drupal - displaying the title of the node within a block

james6848 picture james6848 · Mar 18, 2010 · Viewed 9.7k times · Source

I'm needing to dynamically display the title of a node within a block. I would have thought this would be simple, but all the code snippets I've tried don't seem to work (e.g. <?php print $node->title; ?> )

I've checked and tested that the PHP input format is on and working with other PHP bits and bobs, and everything seems OK.

Any ideas?

Answer

Rajat Gusain picture Rajat Gusain · Apr 2, 2012

Use drupal_get_title() for getting the title of the current page.