Hello-

I'm developing a new Drupal theme, and I want my site slogan to show up only on the front page. I'm using a lot of large fonts, since that seems to be pretty hip right now. It's a bit overbearing to have a huge slogan show up on every page though.

Can I get my slogan to show up only on certain pages? Or maybe someone has a suggestion for how to do it without using the actual "slogan" (maybe a block or something?)

Thanks so much!

Comments

WorldFallz’s picture

you basically answered your own question. probably the easiest thing to do is turn off the theme's slogan and create a custom block that you can then place selectively on pages like any other block.

===
"Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime."
-- Lao Tzu
"God helps those who help themselves." -- Benjamin Franklin
"Search is your best friend." -- Worldfallz

Jeff Burnz’s picture

You can use $is_front, which will return true if the condition is met, i.e you're on the front page.

For example in page.tpl.php

<?php if ($is_front && (isset($site_slogan))): ?>
  <em><?php print $site_slogan; ?></em>
<?php endif; ?>

This tests to see if you are indeed on the front page and if a site slogan is set, if both are true, it prints the $site_slogan. Change the html to suit (I used <em> tags).

Drupal themes

GiorgosK’s picture

I know its a old thread but one might also consider override in template.php file
if you only want slogan on the front page

function THEMENAME_preprocess_page(&$vars) {
  if(!$vars['is_front'])
    unset($vars['site_slogan']);
...

------
GiorgosK
Web Development