2

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

2 Answers 2

8

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.

1
  • Hey, sorry I didn't put it clearly, I'd like to have a link to a content. Thanks. Is the only way to do this is hardcoding the links in page.tpl.php? Or is there a way to add 'privacy' page to footer block from the administration? Commented Jul 22, 2012 at 4:40
2

If you do not feel like writing PHP, then you may consider creating a menu. You can create a placeholder menu item for the static text using the module http://drupal.org/project/special_menu_items. The menu will become available as a block which you can add to your footer region.

Not the answer you're looking for? Browse other questions tagged or ask your own question.