Forum
Can you use Repeaters with Modals - how do pass a different modal number?
v-3.1.1 I need to have an area with unknown number of modals for a gallery. How do you pass the new modal id to the modal.
v-3.1.1 I need to have an area with unknown number of modals for a gallery. How do you pass the new modal id to the modal.
Hi Carol, that should be possible. Can you show the code final html you're trying to achieve?
I am having trouble visualizing how to past the unique modal identifier.
You can use:
<perch:content id="perch_item_index" type="hidden">
. If you can show example code of the modal, we can help with how to implement it.Coding for gallery is not working. Modal image does not show up. First set of code is for page and second set for gallery template ~~ <?php perch_content('gallery'); ?>
<!-- Modal --> <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content">
~~ Gallerytemplate.html ~~ <perch:before> <div class="gallery"></perch:before> <img src="<perch:content type="image" id="image" lable="Image" width="200">" alt="<perch:content type="text" id="alt" label="Description" required help="e.g. Photo of MD John Smith with his best wig on" title>" title="<perch:content type="text" id="alt" label="Description" required help="e.g. Photo of MD John Smith with his best wig on" title>" data-toggle="modal" data-bigimage="<perch:content type="image" id="image" label="Image" width="800"><perch:content type="image" id="image" label="Image" width="600">" data-target="#myModal" class="img-fluid"> <perch:after></div></perch:after> ~~
So when I get this part to work there is a glitch that is not allowing the second image to show up. This is really the first image larger so only one image has to be put in. In a repeater, how am I going to label id=image to be different images and data-target="#myModal" to be different for each entry Could be up to 75 entries.
So that is outputting the code wrongly. What is the output you want. We can work backwards from there.