moving body background image in edit mode

Permalink
Hi,

I found this cool piece of code on the very helpful cheat sheet for moving the body tag image when in edit mode...

<?php 
$cp = new Permissions($c);
if($cp->canAdmin() && $cp->canAddSubContent()){ 
echo '<body style="background-position: 0 50px;" class="' . $c->getCollectionHandle() . '">'; 
} 
else{ 
echo '<body class="' . $c->getCollectionHandle() . '">'; 
}
?>


trouble is I need a little more guidance to get it to work.

Do I need to create some css and target the body tag through an id?

Can some guru please explain a little bit more.

Nige

nige
 
olliephillips replied on at Permalink Reply
olliephillips
That code is intended to be pasted in place of the opening <body> tag in your default.php theme file.

If you are trying to check for edit mode you might be better with:-

<?php
if ($c->isEditMode()){
// Background position nudged
}else {
// Background position normal
}
?>


Just pull your echo statements into that
nige replied on at Permalink Reply
nige
Cheers thank you for that.