$c->isEditMode() not working for some reason

Permalink
*UPDATE*

Sorry, being stupid. $c->isEditMode() is only for when you are actually editing a page, not for when you are logged in. So this post has a use (!), here's what you would do to include something when someone is logged in:

global $u;
if($u->isLoggedIn()) {
// Do something
}


*END UPDATE*

Hi,

For some reason I can't get $c->isEditMode() to work. Below is my code in header.php - am I doing something obviously wrong? Starting to drive me a bit nuts trying to figure it out.

Thanks,

osu

<?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>
<!-- Site Header Content //-->
<link rel="stylesheet" media="screen" type="text/css" href="<?php echo $this->getStyleSheet('css/main.css')?>" />
<link rel="stylesheet" media="screen" type="text/css" href="<?php echo $this->getStyleSheet('css/typography.css')?>" />
<link rel="stylesheet" media="screen" type="text/css" href="<?php echo $this->getStyleSheet('css/nav.css')?>" />
<?php  Loader::element('header_required'); ?>
</head>
<body<?php
   // Add page ID as a class
   echo ' class="pid-'.$c->cID.'"';
   // Add ID depending on whether in edit mode

osu
 
MrNiceGaius replied on at Permalink Reply
MrNiceGaius
I have it working in my header.php file... only difference is this line at the top i.e. in the first php block:
global $c;

Did you try adding it?
MrNiceGaius replied on at Permalink Reply
MrNiceGaius
oops I'm silly... this post is over a year old haha