Forum

Thread tagged as: Question, Problem, Runway

Re-use region content as options for editor in another region

I've got a bunch of repeaters in a multi-level list. The client fills in the name of each region. And later adds those same (exact) names to another region. The idea is that each name is a tag, the tag associated with each card gets filtered in an isotope grid.

The question - how can I reuse the menu list of repeaters that the client made in the other region for the client can choose the tag they made rather then remembering it? A dynamic drop down menu or grid of checkboxes would be ideal. Trying to avoid human error and give them a list of tags based on the other regions that made.

Make sense? Anyone have any suggestions?

Leigh C

Leigh C 0 points

  • 4 years ago

This is very doable and a fieldtype called dataselect exists for exactly this. I can dig it up if you can't find it.

Leigh C

Leigh C 0 points

Thanks Rob! Looking into it.

Leigh C

Leigh C 0 points

So I'd like to pull data from multiple repeater regions on a template. Since they are repeaters, the ID of the items in those repeaters all have the same name --> id="tag"

From this help page it shows pull a region data by it's page, and ID. But what about repeaters? Do I idenitfy them by the ID of the repeater they are inside? https://docs.grabaperch.com/templates/field-types/dataselect/

I've not used this dataselect with a repeater so I am not sure.... Can you show me the template, as this may help me to understand what you hope to happen.

Leigh C

Leigh C 0 points

Sure, this is what I have - 6 groups of dropdown filters for an isotope grid. I'm looking to pull the "tag" ID data from EACH one of the filters.

It seems like it would be inefficient to make 6 different data selects. Any thoughts? (thanks in advance!)

 <div class="button-group filters-button-group multi-select-menu col-md-10 col-xs-12">

<!-- ********** GROUP 1 ********** -->
<div class="col-md-2">
        <select class="option-set clearfix form-control filterfields" data-filter-group="group1">
        <option value="*" data-filter-value="" class="selected"><perch:content id="filter-group-name1" type="text" label="Category" help="E.g. Industry" divider-before="Filter Dropdown Menu 1" /></option>
            <perch:repeater id="filter-group-1"  order="" label="Options" >
                    <option data-filter=".<perch:content id="tag" type="text" label="Unique Tag" required="true" help="CaSE SENSITIVE! Add a tag from the card you have previously made."   />"><perch:content id="filter-menu-item" type="text" required="true" label="Filter Name" help="As it will appear in the drop-down menu." order="4" /></option>
            </perch:repeater>
         </select>
</div>
<!-- ********** END GROUP 1 ********** -->

<!-- ********** GROUP 2 ********** -->
<div class="col-md-2">
        <select class="option-set clearfix form-control filterfields" data-filter-group="group2">
        <option value="*" data-filter-value="" class="selected"><perch:content id="filter-group-name2" type="text" label="Category" help="E.g. Industry" divider-before="Filter Dropdown Menu 2" /></option>
            <perch:repeater id="filter-group-2"  order="" label="Options" >
                    <option data-filter=".<perch:content id="tag" type="text" label="Unique Tag" required="true" help="CaSE SENSITIVE! Add a tag from the card you have previously made."   />"><perch:content id="filter-menu-item" type="text" required="true" label="Filter Name" help="As it will appear in the drop-down menu." order="4" /></option>
            </perch:repeater>
         </select>
</div>
<!-- ********** END GROUP 2 ********** -->

<!-- ********** GROUP 3 ********** -->
<div class="col-md-2">
        <select class="option-set clearfix form-control filterfields" data-filter-group="group3">
        <option value="*" data-filter-value="" class="selected"><perch:content id="filter-group-name3" type="text" label="Category" help="E.g. Industry" divider-before="Filter Dropdown Menu 3" /></option>
            <perch:repeater id="filter-group-3"  order="" label="Options" >
                    <option data-filter=".<perch:content id="tag" type="text" label="Unique Tag" required="true" help="CaSE SENSITIVE! Add a tag from the card you have previously made."   />"><perch:content id="filter-menu-item" type="text" required="true" label="Filter Name" help="As it will appear in the drop-down menu." order="4" /></option>
            </perch:repeater>
         </select>
</div>
<!-- ********** END GROUP 3 ********** -->

<!-- ********** GROUP 4 ********** -->
<div class="col-md-2">
        <select class="option-set clearfix form-control filterfields" data-filter-group="group4">
        <option value="*" data-filter-value="" class="selected"><perch:content id="filter-group-name4" type="text" label="Category" help="E.g. Industry" divider-before="Filter Dropdown Menu 4" /></option>
            <perch:repeater id="filter-group-4"  order="" label="Options" >
                    <option data-filter=".<perch:content id="tag" type="text" label="Unique Tag" required="true" help="CaSE SENSITIVE! Add a tag from the card you have previously made."   />"><perch:content id="filter-menu-item" type="text" required="true" label="Filter Name" help="As it will appear in the drop-down menu." order="4" /></option>
            </perch:repeater>
         </select>
</div>
<!-- ********** END GROUP 4 ********** -->


<!-- ********** GROUP 5 ********** -->
<div class="col-md-2">
        <select class="option-set clearfix form-control filterfields" data-filter-group="group5">
        <option value="*" data-filter-value="" class="selected"><perch:content id="filter-group-name5" type="text" label="Category" help="E.g. Industry" divider-before="Filter Dropdown Menu 5" /></option>
            <perch:repeater id="filter-group-5"  order="" label="Options" >
                    <option data-filter=".<perch:content id="tag" type="text" label="Unique Tag" required="true" help="CaSE SENSITIVE! Add a tag from the card you have previously made."   />"><perch:content id="filter-menu-item" type="text" required="true" label="Filter Name" help="As it will appear in the drop-down menu." order="4" /></option>
            </perch:repeater>
         </select>
</div>
<!-- ********** END GROUP 5 ********** -->



<!-- ********** GROUP 6 ********** -->
<div class="col-md-2">
        <select class="option-set clearfix form-control filterfields" data-filter-group="group6">
        <option value="*" data-filter-value="" class="selected"><perch:content id="filter-group-name6" type="text" label="Category" help="E.g. Industry" divider-before="Filter Dropdown Menu 6" /></option>
            <perch:repeater id="filter-group-6"  order="" label="Options" >
                    <option data-filter=".<perch:content id="tag" type="text" label="Unique Tag" required="true" help="CaSE SENSITIVE! Add a tag from the card you have previously made."   />"><perch:content id="filter-menu-item" type="text" required="true" label="Filter Name" help="As it will appear in the drop-down menu." order="4" /></option>
            </perch:repeater>
         </select>
</div>
<!-- ********** END GROUP 6 ********** -->



</div> <!-- end button group -->

OK, I have met my challenge, I have no idea how to help you here... sorry.

However, I can tell you when I copied your template into a working copy of perch I got this warning (12) times. You can't use - in an ID. Underscores, CamelCase, numbers are OK.

Template tag ID ‘filter-group-name1’ contains disallowed characters

Leigh C

Leigh C 0 points

Thanks for offering anyway Rob. The character are ok - the warning is just that. I've committed to that naming convention so I can't really change it.

Hoping someone else can help?

Leigh,

I know you say it's just a warning, but if you ignore it, your likely to end up in this same forum down the road with a bigger problem.

The warning is "soft" failure, which is obviously something the designers have put in place as a notice of something to fix. (My guess)

Anyways, I do hope you find the answers to your original question and I would think again before going into a project with a known issue, when now is the best time to fix it.

R. K

Drew McLellan

Drew McLellan 2638 points
Perch Support

Dashes have never been permitted as ID values. The warning is to make you aware of the error in your template.

Leigh C

Leigh C 0 points

I realize that, but it's working and I've been building Perch templates with dashes since Perch was born. I've got many sites with all dash-seperated-words from following the way the documentation does it. So I haven't been inclined to change hundreds of template names and reconnecting them is nothing is actually breaking. Do you see any risks with not going through this time consuming task?

Drew McLellan

Drew McLellan 2638 points
Perch Support

No, the warning is to stop people doing it on a new template.

Leigh C

Leigh C 0 points

Hey guys - I realize I never got a solution for this. Is there a way to stack the IDs data from numerous fields? It seems like it would be inefficient to make 6 different data selects.

Drew McLellan

Drew McLellan 2638 points
Perch Support

What do you mean by stack?

Leigh C

Leigh C 0 points

Sorry - stack meaning "a bunch of". I'd like to use data from each repeater list for single dropdown menu with all the tags from those data-selected repeaters. Does that make sense?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Not really - I suspect you'll need to develop a custom field type for that.

Hi Leigh i'm not sure exactly what your trying to achieve –but knowing isotope; have you looked at perch-categories as a for the data-filter-value attribute? So your template would hold... <perch:category id="industry" /> . Your question is looks similar to the issues of relational database design patterns.