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...

<?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();

richgable
 
PineCreativeLabs replied on at Permalink Reply
PineCreativeLabs
Your global areas are conflicting with each other. Each global area needs to be unique. So, try doing the following: instead of using
<?php  $a = new GlobalArea('YourLogo'); $a->display($c); ?>

you would make it unique by having something like this:
<?php  $logo = new GlobalArea('YourLogo'); $logo->display($c); ?>

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.
PineCreativeLabs replied on at Permalink Reply
PineCreativeLabs
I also just noticed that you're missing the
$c
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.
richgable replied on at Permalink Reply
richgable
I see. I tried changing all my values here's my new code.

<?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();


However, it's still doing the same thing. Do I need to make the same changes in the non-Global areas as well?
PineCreativeLabs replied on at Permalink Reply
PineCreativeLabs
Try changing
$logo->display();
to this:
$logo->display($c);
.
You're missing the $c, which needs to be there.
richgable replied on at Permalink Reply
richgable
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);
PineCreativeLabs replied on at Permalink Reply
PineCreativeLabs
Ok, in this case, you may want to try going back to this:
<?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!
jordanlev replied on at Permalink Reply
jordanlev
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.
Mnkras replied on at Permalink Reply
Mnkras
Just a note, Global areas, do not need the $c passed to the display method.
richgable replied on at Permalink Best Answer Reply
richgable
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:

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.
tobygundry replied on at Permalink Reply
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 } ?>