GetSimple Support Forum
Hiding a Component on Homepage / index.php - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16)
+--- Thread: Hiding a Component on Homepage / index.php (/showthread.php?tid=2877)



Hiding a Component on Homepage / index.php - Robzilla - 2012-03-06

Hi there,

is there any way to load a specific component on every site except the index / homepage / startscreen?
I do'nt need breadcrumbs on index /homepage, so i only want to display them on "subpages" of index.

Got no PHP-Skillz. :-(

Thanks & Greetings,
Rob
:-)


Hiding a Component on Homepage / index.php - Carlos - 2012-03-06

Edit your template and change:
Code:
<?php get_component('mycomponent'); ?>
to:
Code:
<?php if (return_page_slug()!='index') get_component('mycomponent'); ?>

Or else, edit the component and enclose its contents between these code:
Code:
<?php if (return_page_slug()!='index') { ?>
... component content ...
<?php } ?>



Hiding a Component on Homepage / index.php - m1k3y - 2012-03-06

More easier would be to make a seperate template and choose this template under the pageoptions of the indexpage


Hiding a Component on Homepage / index.php - Carlos - 2012-03-06

@m1k3y

Yes, you're right. I forgot to mention that other solution.

(However I personally don't like that way, because if I have to do some change to the template, I must do it in both files - unless I split them in pieces with common code and use includes, like the Innovation theme does.)