adambjohnson1

CleanSlate CMS loop with dynamic editable region names

Nov 26th, 2020
602
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <ul class="tab-list">
  2.  
  3.   <r:loop:each times="{$tabs_count}">
  4.     <r:comment>
  5.       <!-- NOTE: Since this & the section below is part of a loop and we want multiple editable regions, we're adding --N onto the end. -->
  6.       <!-- `N` is a number. It creates editable regions with names like `tabs__tab-name--1`. -->
  7.     </r:comment>
  8.     <r:set_var name="tabsName">tabs__tab-name--<r:item /></r:set_var>
  9.  
  10.     <li class="tab-item">
  11.       <a href="#tabs__section--<r:item />" class="tab-link" aria-labelledby="aria__tabs-heading">
  12.         <r:editable_region name="{$tabsName}" type="simple">
  13.           Tab Number <r:item />
  14.         </r:editable_region>
  15.       </a>
  16.     </li>
  17.  
  18.   </r:loop:each>
  19.  
  20. </ul>
RAW Paste Data