Blocks in the header for certain pages only
Permalink
I have a block in the header that I need for certain pages only.
What is the best way to go about this?
Right now I have a header.php file that I am including with all pages for this block.
<?php $a = new GlobalArea('Header Nav'); $a->setBlockLimit(1); $a->display($c); ?>
What is the best way to go about this?
Right now I have a header.php file that I am including with all pages for this block.
- Don't use a global area and have a different set of page defaults for with/without the header
- A different page type for with/without the header
- A page type that renders the area according to a page attribute setting
- Some css to hide it attached to the pages you don't want it.
- Some jQuery to remove or hide it attached to the pages you don't want it.
There are no doubt more variations that others will contribute. Which you use all depends on the amount of coding you are happy to do and the exact circumstances and balance of show/hide.