Tuesday, June 14, 2011

How to create dynamic footer message in drupal

Drupal has a nice feature to input a site wide footer message from the administration panel, it can be found at Administer>>Site configuration>>Site informationn scroll down to Footer message:.

The only thing with this is that it is text only, and what you typically want is to be able to add some dynamic content in there.

To get this value use the following code:

Alternate way:

Just create a block, set the input format to "PHP code" and enter the following code:

© print(date(Y)) ?> print(variable_get('site_name', '')) ?>
All rights reserved

After that you can further customize when and where it will appear, if you need special formatting you can add css classes to it and enhance it's display as needed.

No comments:

Post a Comment