Forum
Change Region Fields in the Back End based on Checkbox
Hi guys,
I'm looking for a way to alter which fields are shown in the Perch admin panel for a region, dependent on the value of a checkbox in that same region.
Here's my code so far:
<perch:content type="select" label="Display As: " id="disp-as" options="Peekthrough|pkthru,Gallery|glry" />
<perch:if id="disp-as" value="pkthru">
<perch:content type="image" label="Top Image" id="proj-pkthru-top" help="2565px x 1315px" />
<perch:content type="image" label="Bottom Image" id="proj-pkthru-bot" help="2565px x 1315px" />
</perch:if>
<perch:if id="disp-as" value="glry">
<perch:before>
<div class="flexslider">
<ul class="slides">
</perch:before>
<li class="<perch:content id="perch_item_index" type="hidden" />">
<img class="full-screen-gallery" src="<perch:content type="image" label="Slider Image" id="slider-image" help="2565px x 1315px" />" alt="<perch:content type="text" id="img-alt" label="Image ALT" />" />
</li>
<perch:after>
</ul>
</div>
</perch:after>
</perch:if>
I could have sworn I've done this before, but I couldn't find anywhere that I had done it successfully, or any other posts in the forums.
Any ideas? Thanks!
No that hasn't ever been possible.
Hi Rachel,
Thanks - would it be possible for me to jump into the code for the back end and put some JQuery in place to accommodate this?
What repercussions would that have when it comes time to update the CMS?
You can add your own JavaScript in a way that is not problematic in terms of updating.
https://docs.grabaperch.com/api/custom-ui/
Note that: