Forum

Thread tagged as: Question, Problem

Repeaters and Select value

I have a content type select option within a repeater. I am unsure how to filter the selected option within the page. In the template I have:

<perch:repeater id="sports" label="Sports" scope-parent="true">
<perch:content label="Sport" type="select" id="repSport" options="Rugby,Football,Cricket,Hockey,Tennis,Real Tennis,Athletics,Boat Club,Clay Shooting,Rifle Shooting,Sailing,Squash,Golf,Ladies Sports" />
</perch:repeater>

And in my page I have:

<?php
perch_content_custom('Representatives', array(
 'template'=>'_rep-details-main.html',
 'filter'=>'repSport',
 'value'=>'sports.repSport.Tennis'
)); 
?>

So it is the value part that is puzzling me. I have tried 'sports.repSport.Tennis' and 'sports.repSport' and 'sports.Tennis' but not getting anywhere.

Ben Stillwell

Ben Stillwell 1 points

  • 7 years ago
Ben Stillwell

Ben Stillwell 1 points
Registered Developer

Actually, got it...just got muddled with filter, match and value.

<?php
perch_content_custom('Representatives', array(
                                'template'=>'_rep-details-main.html',
                                'filter'=>'sports.repSport',
                                'match'=> 'eq',
                                'value'=>'tennis'
                            )); 
                        ?>
Drew McLellan

Drew McLellan 2638 points
Perch Support

You've got it.