Cannot Edit Header.php

Permalink 1 user found helpful
Hi I have quite a few page types on one of my sites, so to clean things up I separated the header code and placed it into header.php and I used the include code on my template pages - I did the same for the footer.

Now when I go into header.php I can see everything fine except I cannot edit it. I realised it was because it was picking up the below.

<?php
Loader::element('footer_required');
?>

I really don't want to have to go into each of my template pages and adding the auto nav block to each one. I thought i could just add it to the header.php and when the template page calls the header then the nav will appear. so if anything needs to be changed it only needs to be done in one place.

Isn't that the point of separating everything?

I anyone could let me know of any solution or of how to go about this I would be greatly appreciative... I might even consider you a god!

thanks
M

 
PineCreativeLabs replied on at Permalink Best Answer Reply
PineCreativeLabs
If you're wanting to add a block to an area that will show up on every page of your site, it will need to be Global. For example, if you want an editable area where you can add a block to it that is global, use a code like this:

<?php  $a = new GlobalArea('Header'); $a->display($c); ?>


When in edit mode, it show as "add to sitewide header". The above works in 5.5.x.
mariaagent replied on at Permalink Reply
Brilliant - thanks it worked! completely forgot about the global area.
aniprasanth replied on at Permalink Reply
thanx, it works well