Global Areas Not Editable
Permalink
Hello, I've done some searching on this and haven't found anything. I have designed my first few templates and they have worked fine, but in this template I included a few Global Regions up top and when I try to click on them to add a block, they do not pull up the menu. However, below the main content of the site I put another global region for the footer and it works fine. Please see the attached video.
http://screencast.com/t/lp8YFe4f4...
Here's my code for the page...
http://screencast.com/t/lp8YFe4f4...
Here's my code for the page...
<?php defined('C5_EXECUTE') or die("Access Denied."); ?> <!DOCTYPE html> <html lang="<?php echo LANGUAGE?>"> <head> <?php Loader::element('header_required'); ?> <link rel="stylesheet" type="text/css" href="<?php echo $this->getThemePath(); ?>/css/style.css" media="all" /> </head> <body> <div id="container"> <div id="head" class="fixed"> <div id="logo-area" class="fixed"> <div id="logo"> <?php $a = new GlobalArea('YourLogo'); $a->display();
Viewing 15 lines of 101 lines. View entire code block.
I also just noticed that you're missing the that's supposed to be within the display(). So, I guess then if you use either of the above lines of code in my previous comment, you should be good to go.
$c
I see. I tried changing all my values here's my new code.
However, it's still doing the same thing. Do I need to make the same changes in the non-Global areas as well?
<?php defined('C5_EXECUTE') or die("Access Denied."); ?> <!DOCTYPE html> <html lang="<?php echo LANGUAGE?>"> <head> <?php Loader::element('header_required'); ?> <link rel="stylesheet" type="text/css" href="<?php echo $this->getThemePath(); ?>/css/style.css" media="all" /> </head> <body> <div id="container"> <div id="head" class="fixed"> <div id="logo-area" class="fixed"> <div id="logo"> <?php $logo = new GlobalArea('YourLogo'); $logo->display();
Viewing 15 lines of 101 lines. View entire code block.
However, it's still doing the same thing. Do I need to make the same changes in the non-Global areas as well?
Try changing to this:
.
You're missing the $c, which needs to be there.
$logo->display();
$logo->display($c);
You're missing the $c, which needs to be there.
Thanks so much for your help... see the new code below. It's still not working for the top elements, but for some reason it's working great for my 2 footer elements.
<?php defined('C5_EXECUTE') or die("Access Denied."); ?> <!DOCTYPE html> <html lang="<?php echo LANGUAGE?>"> <head> <?php Loader::element('header_required'); ?> <link rel="stylesheet" type="text/css" href="<?php echo $this->getThemePath(); ?>/css/style.css" media="all" /> </head> <body> <div id="container"> <div id="head" class="fixed"> <div id="logo-area" class="fixed"> <div id="logo"> <?php $logo = new GlobalArea('YourLogo'); $logo->display($c);
Viewing 15 lines of 101 lines. View entire code block.
Ok, in this case, you may want to try going back to this:
instead of the unique one. But, if the footers seem to work, then maybe those could be kept as unique ones.
I had overlooked that you were missing the $c, so that may have been all you needed to do all along, lol!
<?php $a = new GlobalArea('YourLogo'); $a->display($c); ?>
instead of the unique one. But, if the footers seem to work, then maybe those could be kept as unique ones.
I had overlooked that you were missing the $c, so that may have been all you needed to do all along, lol!
Changing the variable name (for example, from $a to $logo) should not make a difference, because once you call the "display()" method on the area, Concrete5 is done with it -- you're then free to re-assign the variable to another area without any problems.
I'm guessing the issue is one of the other things you've mentioned.
I'm guessing the issue is one of the other things you've mentioned.
Just a note, Global areas, do not need the $c passed to the display method.
Well, I finally got it figured out. It was because I had a z-index in the CSS file. As soon as I took this code out:
Everything started working just fine. Thanks for all the help! It ended up being something in my design from the get-go.
z-index: 10;
Everything started working just fine. Thanks for all the help! It ended up being something in my design from the get-go.
This worked for me too. If you need to keep your z-index like I did, you can use this as a work around:
<?php global $cp; if ($cp->canViewToolbar()) { ?> <script>jQuery(document).ready(function() { jQuery(".your-selector").css("z-index", "auto"); });</script> <?php } ?>
you would make it unique by having something like this:
Notice that $a has been replaced with $logo. You Would do this for your navigation area, and others.
What's happening in your current code is that Concrete basically thinks that all your global areas are the same one, so it causes a conflict and won't work. Making each one unique should work.
Let me know if this helped.