Forum for discussing general topics related to Couch.
3 posts Page 1 of 1
Hi

Sorry still trying to think of a way to have a repeatable region but having a different list in each one so for example if the user could choose what list to choose, for example column one repeatable region they could choose list style a which could be just a normal standard list and then the next column repeat, they could choose list style b which would be a list with parent item like the following example

Code: Select all
<div class="col-lg-6"> <!-- FIRST REPEATABLE COLUMN-->
<ul>
<li>List Item</li>
<li>List Item</li>
</ul>
</div>
<div class="col-lg-6"> <!-- SECOND REPEATBLE COLUMN-->
<ul>
<li>Item Name
<ul>
<li>Child item</li>
<li>Child Item</li>
</ul>
</li>
</ul>
</div>


I thought would a snippet file work?
Hi, I'm not very experienced and maybe my solution is a bit convoluted, but it could be done this way.
On the administrator side, define the type of list you want to use using the check boxes. Frontend side, through IF ... THEN, define which list is to be displayed.
Maybe you could combine it with conditional fields.
ramses2th wrote: Hi, I'm not very experienced and maybe my solution is a bit convoluted, but it could be done this way.
On the administrator side, define the type of list you want to use using the check boxes. Frontend side, through IF ... THEN, define which list is to be displayed.
Maybe you could combine it with conditional fields.


Hi

Thank you for your reply

I did start to do it this way but unsure if is correct way but then thought would need to somehow re order the columns or lists once managed to add the different list style types

Code: Select all
<cms:editable name='listone' label='List Style Type One' type='group' collapsed='1' order='1' />
<cms:editable type='checkbox' name='list_style_one' label='Choose List Style One' opt_values='Yes' group='listone' order='1' />
<cms:editable type='text' name='list_style_one_heading' label='List Heading' group='listone' order='2' />
<cms:repeatable name='liststyleone' label='List Style Type One' stacked_layout='1' group='listone' order='3'>
<cms:editable type='text' name='list_style_type_one_item' label='List Style Type One Item' />
</cms:repeatable>
   
<cms:editable name='listtwo' label='List Style Type Two' type='group' collapsed='1' order='2' />
<cms:editable type='checkbox' name='list_style_two' label='Choose List Style Two' opt_values='Yes' group='listtwo' order='1' />
<cms:editable type='text' name='list_style_two_heading' label='List Heading' group='listtwo' order='2' />
<cms:mosaic name='liststyletwo' label='List Style Two' group='listtwo' order='3'>
<cms:tile name='liststyletwoitem' label='List Style Two Item'>
<cms:editable type='text' name='listtwoparentitem' label='List Style Two Parent Item Name' order='1' />
<cms:repeatable name='styletwolist' label='Style Two List' group='listtwo' order='2' >
<cms:editable type='text' name='stylelisttwochilditem' label='Style List Two Child Item Name'  />
</cms:repeatable>
</cms:tile>
</cms:mosaic>

<cms:if "<cms:get_custom_field 'list_style_one' masterpage='test-lists.php'/>">
          <div class="col-md-3">
              <div class="esc-heading heading-line-bottom lr-line left-heading">
                    <h4><cms:show list_style_one_heading/></h4>
                </div>
            <ul class="list">
                <cms:show_repeatable 'liststyleone' >
                    <li><cms:show list_style_type_one_item/></li>
                </cms:show_repeatable>
            </ul>
          </div>
        </cms:if>

<cms:else />

<cms:if "<cms:get_custom_field 'list_style_two' masterpage='test-lists.php'/>">
                <div class="col-md-3">
                    <div class="esc-heading heading-line-bottom lr-line left-heading">
                        <h4><cms:show list_style_two_heading/></h4>
                    </div>
                   <ul class="list">
                       <cms:show_mosaic 'liststyletwo'>
                           <cms:if k_tile_name='liststyletwoitem' >
                               <li>
                                   <strong><cms:show listtwoparentitem/></strong>
                                   <ul>
                                       <cms:show_repeatable 'styletwolist' >
                                           <li><cms:show stylelisttwochilditem/></li>
                                       </cms:show_repeatable>
                                   </ul>
                               </li>
                           </cms:if>
                       </cms:show_mosaic>
                    </ul>
                </div>
                </cms:if>
3 posts Page 1 of 1