What are "Global Areas No global areas created yet."
Permalink 1 user found helpful
When you go to the Stacks section of 5.5.1 it also says:
"Global Areas No global areas created yet."
I hate to sound dense, but what are those?
"Global Areas No global areas created yet."
I hate to sound dense, but what are those?
So basically if your theme doesn't already have it, and if you don't modify the source code, it's not something you would/could use?
I want to add a logo.gif and I have looked all over the web and the only thing that I find is that I go to "stacks" then "global area" and click on "site name".
The problem is that when I go to stacks I see this:
No global areas created yet.
Can anyone tell me how to create a global area, or give me the code to put in the header.php
FRUSTRATING...
The problem is that when I go to stacks I see this:
No global areas created yet.
Can anyone tell me how to create a global area, or give me the code to put in the header.php
FRUSTRATING...
Insert the code posted by mesuva in your php template or header.php exactly where you want the logo, naming area as you want (Ex: Logo Placeholder):
Now go to Stacks in the Dashboard.
A new Global Areas section was created with your Logo Placeholder inside.
Add an image block or other block you prefer with your logo.
Thats all.
Hoping this will help you.
$a = new GlobalArea('Logo Placeholder'; $a->display($c);
Now go to Stacks in the Dashboard.
A new Global Areas section was created with your Logo Placeholder inside.
Add an image block or other block you prefer with your logo.
Thats all.
Hoping this will help you.
Just an FYI you have a typo the code should be:
I figured I would clarify that just encase someone was copy and pasting your code.
$a = new GlobalArea('Logo Placeholder'); $a->display($c);
I figured I would clarify that just encase someone was copy and pasting your code.
This just made my life 1000 times easier. Thank you very much!
And you have to log out and in again to see the new global area in dashboard -> stacks.
Should it not be:
Just wondering as this is what I have always used?
$a = new GlobalArea('Logo Placeholder'); $a->display( );
Just wondering as this is what I have always used?
You're right, Bashfulmonk. The display method of GlobalArea doesn't want the $c parameter (c like Collection). It finds it out by itself.
/concrete/models/global_area.php
Howerver, normal Areas do need the collection.
/concrete/models/area.php
/concrete/models/global_area.php
public function display() { $c = Page::getCurrentPage(); parent::getOrCreate($c, $this->arHandle, 1); parent::display($c); }
Howerver, normal Areas do need the collection.
/concrete/models/area.php
function display(&$c, $alternateBlockArray = null) { if(!intval($c->cID)){ //Invalid Collection return false; } ...
Normally in a template file you would create an area like this:
But now in 5.5, you can make it a global area by doing this instead:
There were sort of hacky ways to achieve this in 5.4.x, now this is a really nice way of having a common area across your pages.
Once concrete5 sees that global area, you'll see it in the stacks section and it's treated like a stack.