Hiding the sitewide name and Headernav from a Single Page
Permalink
I know that concrete5 inserts the single page in between the header and footer of the theme, but what if on a certain page I want to hide these sidewide components without removing them from the rest of the site?
Thanks in advance!
Thanks in advance!
Worked great, thanks! I was just hoping there was a way from the dashboard to maybe add some kind of property to the single page to remove it from global things like that, but I guess it takes a little code to get the logic down.
Thank you for this piece of code Jordanlev
I'm building a single page on my site that will use a different theme, a mobile version. But when I test it, the header from the normal version is appearing. I put your code in both the main theme view.php and the mobile page theme view.php (see below), but there is no change.
I'm building a single page on my site that will use a different theme, a mobile version. But when I test it, the header from the normal version is appearing. I put your code in both the main theme view.php and the mobile page theme view.php (see below), but there is no change.
<?php if ($c->getCollectionPath() == '/mobile'): ?> <!-- header_remove --> <?php else: ?> <!-- header_view --> <?php endif; ?>
Since single_pages always need to exist at a specific path in your site, you can check for this page like so:
Or if you have a controller you could have it pass a variable to the view with $this->set('is_special_page', true) ... then your if statement can be "if (isset($is_special_page))...".
Hope that helps!
-Jordan