Hiding a block element in edit mode
Permalink Browser Info Environment
Thank you for creating this block. It allows a non-programmer from myself to create some great custom blocks for my client.
I have added a slider based on the jquery flexslider but it is not editable when I put the page in edit mode. I am able to add the various elements and the slider operates fine, but the if I add multiple slides, I am only able to edit the first slide. All other slides are hidden behind the first element. After some testing it appears that if I can hide the images from displaying in edit mode, my clients will be able to edit the slider.
Any tips on how to hide it in view.php file that is generated?
The code is:
Thanks again for creating such an amazing plugin.
I have added a slider based on the jquery flexslider but it is not editable when I put the page in edit mode. I am able to add the various elements and the slider operates fine, but the if I add multiple slides, I am only able to edit the first slide. All other slides are hidden behind the first element. After some testing it appears that if I can hide the images from displaying in edit mode, my clients will be able to edit the slider.
Any tips on how to hide it in view.php file that is generated?
The code is:
<?php defined('C5_EXECUTE') or die("Access Denied."); ?> <li> <div class="info animate-in"> <?php if (!empty($field_2_textarea_text)): ?> <h3><?php echo nl2br(htmlentities($field_2_textarea_text, ENT_QUOTES, APP_CHARSET)); ?></h3> <?php endif; ?> <?php if (!empty($field_3_textbox_text)): ?> <h2><?php echo htmlentities($field_3_textbox_text, ENT_QUOTES, APP_CHARSET); ?></h2> <?php endif; ?> <?php if (!empty($field_4_textarea_text)): ?> <h4><?php echo nl2br(htmlentities($field_4_textarea_text, ENT_QUOTES, APP_CHARSET)); ?></h4> <?php endif; ?> <?php if (!empty($field_5_textbox_text)): ?> <p><a href="<?php echo htmlentities($field_5_textbox_text, ENT_QUOTES, APP_CHARSET); ?>" class="button button_pale">
Viewing 15 lines of 26 lines. View entire code block.
Thanks again for creating such an amazing plugin.
Type: | Discussion |
---|---|
Status: | New |
<?php if (!Page::getCurrentPage()->isEditMode()): ?>
//...your stuff here
<?php endif; ?>
I think your best bet might be to put that around the javascript that initiates the slider. (Or you could put it around the images themselves if you want).
You also might be interested in this tutorial I wrote, which shows how to build a FlexSlider block (but it uses the file manager's File Sets to choose the images, not Designer Content):
http://c5blog.jordanlev.com/blog/2011/12/build-a-slideshow-block/...
Best,
Jordan