Forum

Thread tagged as: Question, Problem, Discussion

Best way to have a looped group list?

Hi,

I'm in the process of changing this static site page into being driven by perch. However, I'm having trouble working out he best way to loop out a grouped list. I am trying to get the rough output market below but not sure the best approach?

Do I use perch before conditionals and then the multiple regions option or take advantage of categories? On the page layout I have created a perch_content section for each left and right of the page.

Any suggestions would be appreciated.

<h3> Section title</h3>
<ul>
<li>treatment £25.00</li>
</ul>
<h3> Next Section title</h3>
<ul>
<li>treatment £25.00</li>
</ul>
Andrew Cetnarskyj

Andrew Cetnarskyj 0 points

  • 5 years ago

I have this as a starter in my template

 <perch:before>
 <h3>
    <perch:categories id="hair-treatment-type" label="Hair Treatment Type" set="hair-treatments" order="3" />
        <perch:category id="catTitle" />
    </perch:categories>
</h3>
  <ul>
 </perch:before>

  <li>
    <perch:content id="treatment-title" type="text" label="Treatment Title" required="true" title="true" order="1"/>
    &nbsp;
    &pound;<perch:content id="treatment-price" type="text" label="Price (&pound;)" required="true" order="2"/>
  </li>

<perch:after>
</ul>
</perch:after>
Drew McLellan

Drew McLellan 2638 points
Perch Support

You could make each section an item, and then use a repeater for the treatments, perhaps.