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.



Type: Discussion
Status: New
View Replies:
marcantondahmen replied on at Permalink Reply
Hi Torsten,

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...

clareforndran replied on at Permalink Reply
Trying to do the same thing! Let me know if you come up with a solution! :)
marcantondahmen replied on at Permalink Reply
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):
if ($pStyle != "Home") {
} 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.

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.