We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Problem

Categories inside repeaters not working

Categories stop working when inside a repeater.

This works:

<div class="chartWrap">
    <div class="chartItem verlag"><perch:content id="item" type="text" label="Name" required="true" /></div>
    <div class="chartBar"><span><span style="width:<perch:content id="percent" type="text" label="Percent Full" help="Please enter a number 0-100" required="true" />%; background-color:<perch:categories id="categories" set="pipeline" display-as="checkboxes" label="Category" help="Please choose only one category"><perch:category type="color" id="color" /></perch:categories>;"></span></span></div>
</div>

This doesn't work:

<perch:repeater id="idontwork" Label="Content">
    <div class="chartWrap">
        <div class="chartItem verlag"><perch:content id="item" type="text" label="Name" required="true" /></div>
        <div class="chartBar"><span><span style="width:<perch:content id="percent" type="text" label="Percent Full" help="Please enter a number 0-100" required="true" />%; background-color:<perch:categories id="categories" set="pipeline" display-as="checkboxes" label="Category" help="Please choose only one category"><perch:category type="color" id="color" /></perch:categories>;"></span></span></div>
    </div>
</perch:repeater>

It does work with blocks though:

<perch:blocks>
  <perch:block type="quote" label="Chart Item">
    <div class="chartWrap">
        <div class="chartItem verlag"><perch:content id="item" type="text" label="Name" required="true" /></div>
        <div class="chartBar"><span><span style="width:<perch:content id="percent" type="text" label="Percent Full" help="Please enter a number 0-100" required="true" />%; background-color:<perch:categories id="categories" set="pipeline" display-as="checkboxes" label="Category" help="Please choose only one category"><perch:category type="color" id="color" /></perch:categories>;"></span></span></div>
    </div>
  </perch:block>
</perch:blocks>

Diagnostics:

Perch: 2.8.7, PHP: 5.5.11, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: bf9ad53b11c9a57efdb1057292d73b928b8c5c77 $, with PDO
Server OS: WINNT, apache2handler
Installed apps: content (2.8.7), assets (2.8.7), categories (2.8.7)
App runtimes: <?php $apps_list = array( 'content', 'categories', );
PERCH_LOGINPATH: (removed)
PERCH_PATH: (removed)
PERCH_CORE: (removed)
PERCH_RESFILEPATH: (removed)
Image manipulation: GD
PHP limits: Max upload 1000M, Max POST 1000M, Memory: 500M, Total max file upload: 500M
Resource folder writeable: Yes
HTTP_HOST: (removed)
DOCUMENT_ROOT: (removed)
REQUEST_URI: (removed)
SCRIPT_NAME: (removed)
Shane Lenzen

Shane Lenzen 18 points

  • 4 years ago
Drew McLellan

Drew McLellan 2637 points
Perch Support

You can't categorise repeater items. If you find yourself needing to, you probably need to rethink your data structures.

Got it, thanks. I needed to give the client a way to create categories with associated content, then create multiple items within a region and assign them categories in order to pull in the associated content. Solved it with blocks.