I have a theme called Global Industrial, http://www.drupal-themes.adodis.com/global-industrial-free-theme, and I was wondering how I could make it to where the slider only appears on the front page of my site. The slider isn't considered a block which makes it harder. Any help would be greatly appreciated.

Comments

nevets’s picture

If the slider is embedded in page.tpl.php you can surround it like this

if ( $is_front ) :
... Existing slider html ...
endif;
it will only show on the front page.

carlitros’s picture

This solution works for show the Slider only in front page, but:
Anybody know how to print the slider banner only in front and also in some specific nodes?

Regards and thanks,

nevets’s picture

Not a great approach but you could change

if ( $is_front ) :

to

$nids = array(2, 3, 10);  // The list of node ids (nids) you want the slider to show on
if ( $is_front || ( !empty($node) && in_array($node->nid, $nids) ) ) :
Jimmel’s picture

Not sure how it is done in drupal 7 but in 6 you use the page-front.tpl.php for the front page and alter the page.tpl.php so the slider is not on the rest of the site. Might have changed for 7 but doubt it has changed that much.

phillyman1025’s picture

Thanks for all the help problem solved!

Klaus1973_Ducati’s picture

And how the problem solved - please write

olufemiadeleke’s picture

Hi i have the exact same problem u had, please explain to me how you solved it, Im very green. thank you

Anthony Pero’s picture

either way listed works. It's up to you. Using the php if statement will be slightly slower than using a dedicated page-front.tpl.php file, since it will need to be parsed on every page. But we are talking fractions of a second.

Anthony Pero
Project Lead
Virtuosic Media
http://www.virtuosic.me/

mongol2012’s picture

we are dying to know the detail

mongol2012’s picture

 if ( $is_front ) : 

if(theme_get_setting('slideshow')=='yes'):

print render($slideshow);
 endif; 

endif;

olufemiadeleke’s picture

Thanks solved!