"add to ..." block won't respond in edit mode

Permalink 1 user found helpful
I am trying to set up my first theme in C5, and slowly getting the feel for it - never did any php before. I have a header and footer element, and default page, and everything is lining up nicely.

But when I put a content area into the header area with
<?php    $content = new Area('Content');   $content->display($c);   ?>


it will appear as a block when I go into edit mode, but when I click on it nothing happens. Any ideas what I have done wrong?

(I have been able to put the same thing into the default.php page and it works nicely.)

Thanks.

sceva
 
sceva replied on at Permalink Reply
sceva
I have been thinking about this... could it be that you can't have editable blocks in the header and footer?
sceva replied on at Permalink Reply
sceva
... and if you can't edit the header and footer, where can I find out how to add the Auto Nav or Header Nav to the header? Thanks.
ThemeGuru replied on at Permalink Reply
ThemeGuru
Here is an example header:

<?php  defined('C5_EXECUTE') or die(_("Access Denied.")); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd">
<html lang="en">
<head>
<link rel="stylesheet" media="screen" type="text/css" href="<?php echo $this->getStyleSheet('main.css')?>" />
<link rel="stylesheet" media="screen" type="text/css" href="<?php echo $this->getStyleSheet('typography.css')?>" />
<?php  Loader::element('header_required'); ?>
</head>
<body>
<div id="page">
   <div id="header">
      <h1 id="logo"><a href="<?php echo DIR_REL?>/"><?php echo SITE?></a></h1>
   </div>
   <div id="nav">
Mnkras replied on at Permalink Reply
Mnkras
instead of that code above just use this code

<?php
$a = new Area('Main');
$a->display($c);
?>
sceva replied on at Permalink Reply
sceva
Thanks for the help... I have seen that if I name the new area 'Header Nav' then a block will appear on the header with the directory tree, but it is in the default bullet list format. How can I apply the css settings to this area? I can still not edit the block when in edit mode...
sceva replied on at Permalink Reply
sceva
I thought I had figured this out, but it came back again. To summarize, I create a content area like:
<?php
$a = new Area('Main');
$a->display($c);
?>


and everything is hunky dory (that means good). I can see the area, and edit when in edit mode on the page. Then when coming back to the page to edit it later, the area shows up highlighted like the other areas, and it will go gray when mousing over it, but the pointer doesn't turn into a hand, and clicking on it doesn't bring up the option menu... Could something be caching in firefox? Or something else? Thanks.
elyon replied on at Permalink Reply
elyon
Check to see if there are any script errors. It requires Javascript to let you add blocks to the area. If the text is appearing but it doesn't function, it usually means that something in your theme or block content is throwing a Javascript error, which prompts the browser to stop Javascript execution at that point in the page.
sceva replied on at Permalink Reply
sceva
The rest of the items on the page below this still work properly. (I looked for errors, and there are a couple, but I don't think they relate to this... but I am not an expert!!) Are you saying that none of the javascript will work? Thanks.
ThemeGuru replied on at Permalink Reply
ThemeGuru
Post the theme/link so we can take a closer look.
sceva replied on at Permalink Reply
sceva
I was able to 'undo' enough in my editor and get it working again. If it happens again i will repost. Hopefully you won't hear from me! I also cleared the cache in Firefox, so I don't know exactly what was causing it...
ThemeGuru replied on at Permalink Reply
ThemeGuru
Ya I know from experience sometimes after you fix the problem it just keeps producing until you clear the cache in firefox.

But good news to hear is all sorted out!

Cheers,

Thomas
nickratering replied on at Permalink Reply
nickratering
It's propably a style element in your theme CSS-file.
Sometimes when you use floating divs, you do get the dotted border, but it's unclickable. Try to avoid floating divs.
Also, if you work with absolute or relative positioned elements with z-indexes, it might conflict with the edit-mode-css.
It's also possible to set something different in your in-edit-mode theme by using:
<div id="mainContents" <?php if ($c->isEditMode()) { ?> style="float: none;" <?php  } ?>>

Try to avoid z-indexes in editable regions.