Home Forums Add-ons Repeater Field Probleme with repeater field and modal Zurb Foundation


Probleme with repeater field and modal Zurb Foundation

  • Hello, i have a problem with my modal and repeater field

    <?php while(the_repeater_field('serviceshomepage')): ?>
    	<div class="medium-3 columns">
    		<a href="#" data-reveal-id="myModal1">
    		<img src="<?php the_sub_field('imgcontent'); ?>"/>
    		<h5 class="title-presta"><?php the_sub_field(’title'); ?></h5>
    	<div id="myModal1" class="reveal-modal" data-reveal>
    		<div class="medium-12 columns">
    			<img src="<?php the_sub_field(‘imgcontent'); ?>"/>
    		<a class="close-reveal-modal">×</a>
    <?php endwhile; ?>

    My problem is : when i click on the image 1, 2, 3…. there is the modal 1 which open. Ofcourse because the data-reveal-id is myModal1.
    Do you know with what can i change it for use the repeater field.

    I won’t use simple field because i have lot’s of modal … =(

    Please help me!!!! =(

    Sorry for my english, i’m french.


  • <?php if( have_rows('bloc-modal')) : ?>
    				<?php $i = 0; while(the_repeater_field(‘bloc-modal')): ?>
    					<div class="medium-3 columns »>
    						<a href="#">">
    							<img /> »/>
    							<h5 class="title-presta"><?php the_sub_field('menu_titre'); ?></h5>
    						<div id="myModal<?php echo $i ?>" class="reveal-modal" data-reveal>
    							<div class="medium-12 columns »>
    								<img /> »/>
    				<?php $i++ ; endwhile; ?>
    			<?php endif; ?>
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.