Area in header file
Permalink
Hello C5 community,
I've been working on my first Concrete5 site for a while now and have run into the following problem:
I want to add a new area inside the header file, but it only seems to accept GlobalAreas.
The following code doesn't work:
Whilest the following does work:
The blocks for this area should be page specific and not site wide. What am I doing wrong?
Header include:
All other area's and global area's work as expected. I've also tried removing all my JS and CSS but this doesn't change anything. I've also tried searching the forums and google but couldn't find any solution.
Wit kind regards
Svdb87
I've been working on my first Concrete5 site for a while now and have run into the following problem:
I want to add a new area inside the header file, but it only seems to accept GlobalAreas.
The following code doesn't work:
<?php $a = new Area('Subscription link'); $a->display($c); ?>
Whilest the following does work:
<?php $a = new GlobalArea('Subscription link'); $a->display(); ?>
The blocks for this area should be page specific and not site wide. What am I doing wrong?
Header include:
$this->inc('elements/header.php');
All other area's and global area's work as expected. I've also tried removing all my JS and CSS but this doesn't change anything. I've also tried searching the forums and google but couldn't find any solution.
Wit kind regards
Svdb87
Hi Jordi,
Thank you for your suggestion. I've re-checked this by changing to
Unfortunately this doesn't change anything for me.
Thank you for your suggestion. I've re-checked this by changing to
<?php $a = new Area('New random name'); $a->display($c); ?>
Unfortunately this doesn't change anything for me.
<?php
$a = new Area('Subscription link');
$a->display($c);
?>
works ok for me in the header.php using default elemental theme
$a = new Area('Subscription link');
$a->display($c);
?>
works ok for me in the header.php using default elemental theme
I figured it out. Made the stupid mistake by using $c somewhere else in the header. *slaps brain*
try giving the new Area a different name than the existing Global Area. I think there were issues when you try to create an area with a name you've already used for a global area.
Hope this helps,
Jordi