Support

Account

Home Forums General Issues Repeater Field code issue

Unread

Repeater Field code issue

  • Trying to setup accordion style on page-template. I’m missing a step or not setting it up properly and could you some assistance.

    So I’m trying to create repeater fields that allow an accordion tab to display the category and then the accordion that’s active displays all the products in that category….

    
    <div class="tabs">
    <button class="tablink" onclick="openPage('Vibration Meters', this, '#e67425')">Vibration Meters</button>
    </div>
    <div id="Vibration Meters" class="tabcontent">
    <ul class="list--unstyled">
    <li><a href="#" target="_blank">Product Name</a></li>
    </ul>
    </div>
    

    I have incorporated the above code to this…..

    
    <?php if(function_exists('get_field')){
    $product=get_field("product");
    }?>
    
    <?php if ($product) { ?>
      <div class="product_section">
    	  <div class="container">
    		  <h2>Products</h2>
    				
    	
      <?php foreach($product as $product) {
    	  $tab_title = $product['tab_title']; ?>
    		<div class="tabs">
                        <button class="tablink" onclick="openPage('<?php echo $tab_title; ?>', this, '#e67425')"><?php echo $tab_title; ?></button>
    		</div>
    				
          <?php foreach($item as $item) {
    	$product_image = $item['product_image'];
            $product_title = $item['product_title'];
    	$product_link = $item['product_link']; ?>
    					
    	  <ul class="list--unstyled">
    		<div id="<?php echo $tab_title; ?>" class="tabcontent">
    		  <li class="single-product">
    		    <a>" target="_blank">
    		    <img />" class="product_image">
    		    <br><?php echo $product_title; ?></a>
    		  </li>
    		</div>
    	<?php } ?>
    	<?php } ?>
    	</ul>	
    </div>
    </div>
    <?php } ?>
    
Viewing 1 post (of 1 total)

The topic ‘Repeater Field code issue’ is closed to new replies.