Global Block1 user found helpful
I have been away from C5 some time now but i just got som sparetime and i wanna catch up on things. My first problem is how to make a global block? I want a global area which is editable by my client and once edited all sites with this block should ofcause be updated. I need this for a footer so i cant just hardcode it, since some of the blocks will be frequently updated by client.
I have been looking in different cheat sheets of c5 etc. but with no luck - is it really so that they havent allready thought of this option?
You could try:
<div class="footer"> <?php $a = new GlobalArea('Foot1'); $a->display($c); ?></div>
Or something similar
The lowercase g in globalArea used to be valid pre 5.6, did it not? It's certainly how I was using it all along...
new globalArea ('blah');
I've got a handful of sites to upgrade to 5.6, I've been holding off because of this, it's not a huge time sink to change during an upgrade but still precious minutes being precious and all. Was this an intentional change? What is the reason to not just support the lower case g as a legacy thing?
It does depend on your theme specifying that an area should be a global area as a opposed to an area but this is simple.
$a = new GlobalArea('Top Bar Left'); $a->display($c);
rather than this:
$a = new Area('Top Bar Left'); $a->display($c);
Any block you put in that area will be appear on all pages using that page_type and if used across all page_types, all pages of your site.
Hope that helps.
actually here the line is:
Fatal error: Class 'globalArea' not found in /var/www/floatleft.dk/public_html/fond/themes/default/full.php on line 9
What am i missing?
i used this:
<?php $a = new globalArea('Main'); $a->display($c); ?>
Sent from my iPhone
If i use this code under here, (the normal block type) i dont get any error... its weird.
<?php $as = new Area('Main'); $as->display($c); ?>
Thx and have a good weekend :-)
EDIT: Ahh crap, i spelled global with a non capital g... Thats prolly it!
To get around this issue, you could add the stack to a page and then set the permissions so that only certain people can edit it.