Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drupal 7 - Adding content and a piece of text to footer region

I'd like to add the followings into footer region / block in drupal 7.

  1. A 'privacy' link to a content which is just a basic page content
  2. A piece of text 'Copyright 2012'

The footer will look like this Copyright 2012 | link to privacy

What is the best way to do this?

Thanks

like image 670
Adrian Gunawan Avatar asked Feb 03 '26 12:02

Adrian Gunawan


1 Answers

Go to Administer > Structure > Blocks and create a new block. You can enter title as "" to prevent title from printing. Enter you content, and choose an appropriate input format (full HTML, etc). Save it. Then, move the block to appropriate region. Most themes have a footer area that you drag and drop the block's handler to (not to the exact region. There is a drop zone middle of the page).

You can also add this text page.tpl.php file in your theme's folder.

You can embed links either using raw HTML or using PHP (which reflects correct URLs with path auto always). If you don't want to embed php in a block, which requires you to enable PHP Filter module (from core), put this in page.tpl.php.

<div id="footer-text">
 <?php print l(t('Privacy policy'), 'node/5'); ?> | <?php print t('Copyright @year', array('@year' => date("Y"))); ?>
</div>

This should print the Privacy text linked to node/5 considering alias, and Copyright [year] with both labels translatable.

like image 168
AKS Avatar answered Feb 05 '26 04:02

AKS