IfisEdit Mode for visibility...

Permalink 1 user found helpful
Hi, I have a complicated front page of a site that the client would like to make more editable. It has js pop ups on bio photos over a glowing js star. (tell me about it!)www.candylane.co.nz

I think I can handle making the bio photos etc editable by putting them in editable areas (rather than hard coded) but the js pop up on rollover contains the teachers name.

If the client wants to replace or remove a teacher (and they do) they will need to able to alter these js popup details.

At the moment the pop ups are in a div with visibility:hidden. Is it possible to set that to visibility:visible BUT only for edit mode?

Nige

nige
 
12345j replied on at Permalink Best Answer Reply
12345j
yeah. I usually check for edit mode in the <body> and add a class if it is. something like
<body <?php if ($c->isEditMode()) {?>class="editmode"<?php}?>>
and the do something like
.bio {display:none;}.editmode .bio {display:block;}
nige replied on at Permalink Reply
nige
Thank you.
nige replied on at Permalink Reply
nige
Just one question about that syntax?

In your example does the body tag need to be closed? I'm struggling to get it to work...

Nige
12345j replied on at Permalink Reply
12345j
yeah, it does, sorry. I've updated it now.
nige replied on at Permalink Reply
nige
oh right just like that. I did that and thought, that doesn't look right, so cheers I'll give it a go...
nige replied on at Permalink Reply
nige
Excellent thats working thanks a lot.

How about this one? Can I turn off js in editmode?

Nige
12345j replied on at Permalink Reply
12345j
custom or core? core would be a pain in the ass, custom not so much
nige replied on at Permalink Reply
nige
Custom, its an attached js script called thus:

<script type="text/javascript" src="<?php echo $this -> getThemePath (); ?>/homeTest.js"></script>


Nige
12345j replied on at Permalink Reply
12345j
just do
<?php if (!$c->isEditMode()) {?>
  //load js here
<?php}?>
nige replied on at Permalink Reply
nige
Cool but won't that turn it ON in Edit Mode?

Nige
12345j replied on at Permalink Reply
12345j
not if you use the ! negative declaration.
nige replied on at Permalink Reply
nige
Ahhhh brilliant, that explains a lot (and in the past)

Cheers for all your help mate.

Nige