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?

View Replies: View Best Answer
mesuva replied on at Permalink Best Answer Reply
They are technically stacks, but they are automatically created when a global area is defined in the theme itself.

Normally in a template file you would create an area like this:
$a = new Area('Header Nav');

But now in 5.5, you can make it a global area by doing this instead:
$a = new GlobalArea('Header Nav');

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.
dibbc replied on at Permalink Reply
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?
geniewish replied on at Permalink Reply
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

manuelvalle replied on at Permalink Reply
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):
$a = new GlobalArea('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.
dkroy replied on at Permalink Reply
Just an FYI you have a typo the code should be:
$a = new GlobalArea('Logo Placeholder');

I figured I would clarify that just encase someone was copy and pasting your code.
dankoerner replied on at Permalink Reply
This just made my life 1000 times easier. Thank you very much!
TorstenKelsch replied on at Permalink Reply
And you have to log out and in again to see the new global area in dashboard -> stacks.
Bashfulmonk replied on at Permalink Reply
Should it not be:

$a = new GlobalArea('Logo Placeholder');
$a->display( );

Just wondering as this is what I have always used?
orisinal replied on at Permalink Reply
You're right, Bashfulmonk. The display method of GlobalArea doesn't want the $c parameter (c like Collection). It finds it out by itself.

public function display() {
  $c = Page::getCurrentPage();
  parent::getOrCreate($c, $this->arHandle, 1);

Howerver, normal Areas do need the collection.

function display(&$c, $alternateBlockArray = null) {
    //Invalid Collection
    return false;