Cant get if($c->isEditMode()) to load any css

Permalink
Hi There,

I can't seem to get c5 to load any CSS when in edit mode - I'm using the following:
<?php // conditionally load css file if in edit mode (to fix theme conflicts with c5 dashboard)
    if($c->isEditMode()){ ?>
      <link href="<?php echo $this->getThemePath(); ?>/assets/css/editmode.css" rel="stylesheet">
    <? }
  ?>


I've triple checked the theme path but I'm obviously missing something simple, is there a trick to getting this to work?

Cheers

Ben

 
planist1 replied on at Permalink Best Answer Reply
planist1
Try this

<?php global $c;
// conditionally load css file if in edit mode (to fix theme conflicts with c5 dashboard)
    if($c->isEditMode()){ ?>
      <link href="<?php echo $this->getThemePath(); ?>/assets/css/editmode.css" rel="stylesheet">
    <? }
  ?>
cmscss replied on at Permalink Reply
That worked - thanks!

Is there a way to load css when logged in so the edit buttons look normal before you click to edit them?
planist1 replied on at Permalink Reply
planist1
You are welcome.
global $u;
if($u-> isLoggedIn ())
{
something
}
cmscss replied on at Permalink Reply
Perfect thanks.