Exclude pages from home page
Permalink Browser Info Environment
Hi Marc,
is it possible to hide pages underneath a subpage only on the homepage?
Sample: three categories: Portfolio, News and Services (all have subpages). I don't wanna show the subpages from services on homepage but on services page.
Regards
Torsten
is it possible to hide pages underneath a subpage only on the homepage?
Sample: three categories: Portfolio, News and Services (all have subpages). I don't wanna show the subpages from services on homepage but on services page.
Regards
Torsten
Type: | Discussion |
---|---|
Status: | New |
Trying to do the same thing! Let me know if you come up with a solution! :)
Hey guys,
you can try to add this to your elements/pagelist.php (in the package's directory):
First find and modify the following condition (line 47):
Then you have to create a custom attribute 'exclude_home' in the dashboard and apply it to all pages you want to hide on the home page.
That's it.
you can try to add this to your elements/pagelist.php (in the package's directory):
First find and modify the following condition (line 47):
if ($pStyle != "Home") { $pl->filterByParentID($page->getCollectionID()); } else { $pl->filterByAttribute('exclude_home', 0); }
Then you have to create a custom attribute 'exclude_home' in the dashboard and apply it to all pages you want to hide on the home page.
That's it.
at the moment the page lists get all filtered by the "exclude_page_list" attribute, but as you said, that will remove a page from all page lists.
If you are not afraid to dig a bit into the theme, there would be the option to add another attribute (for example the "featured" attribute) to a page and also filter only the homepage by that attribute.
You can check the elements directory (not the theme's directory) within the package folder for the pagelist.php.
That file handles all the page list logic.
Hope that helps or at least points you into the right direction...
Cheers!