Global Area

Permalink
Hello,

I can't find good documentation about the 'globalArea'-function.

So, i have set my first steps integrating my own html-page in C5 and adding simple area's, but now trying understand how the globalArea-function works and how can used in my theme?
Can somebody explain how use this function?

Regards,
Christophe

 
ConcreteOwl replied on at Permalink Best Answer Reply
ConcreteOwl
If you have a site that displays the same content on each page, or even the same content on several pages..
By using the GlobalArea in your page type, you only need to enter the content in one page for it to be automatically repeated to all the pages using that GlobalArea name.
This is usually used for displaying content in the header, footer and nav sections, but it can be very useful in many other sections of a site.
ctuxboy replied on at Permalink Reply
Hi @weyboat,

Sorry for the delay. Today struggeling with some WordPress updates for clients :-(

Hope building very soon websites for clients with C5 ;-)

Find also this useful answer:
https://www.concrete5.org/community/forums/5-7-discussion/creating-n...

So adding this in the footer:
<section>
   <div class="columns">
      <div class="column">
         <?php
         $a = new GlobalArea('Footer 1');
         $a->display();
         ?>
      </div>
      <div class="column">
         <?php
         $a = new GlobalArea('Footer 2');
         $a->display();
         ?>
      </div>
      <div class="column">


And see it in the 'Stacks and blocks'

So it works perfect!
That's really useful :-)

If you have other hints or tips for adding in my theme taht can be very useful....

(The problem for a new C5 user is that it's not all well documented. It's a challenge understand how all the things works, without good and up-to-date docs.)