Forum

Thread tagged as: Question, Problem

Tables with Repeater Regions

I am creating a table of which will have 2 columns but an unlimited amount of rows. With that in mind I opted to use a repeater region in order to give the user the ability to only add a new row as it is needed but upon uploading the template and filling everything out in the admin section, there is nothing that is being output.

Nothing shouts out at me from my code so wondering you someone here could shed any light on my problem?

Code Below...


<!-- ENGLISH LANGUAGE --> <perch:if id="lang" value="en" match="eq"> <perch:content id="intro-english" label="English Intro" type="textarea" editor="markitup" textile="true" divider-before="English Language" /> <perch:before> <table width="600" border="0"> </perch:before> <tr> <td width="251">Position</td> <td width="249">Availability</td> </tr> <perch:repeater id="opportunities-english"> <tr> <td><perch:content id="position-english" type="text" label="English Position" editor="markitup" textile="true" required="true" /></td> <td><perch:content id="availability-english" type="text" label="English Availability" editor="markitup" textile="true" required="true" /></td> </tr> </perch:repeater> <perch:after> </table> </perch:after> </perch:if> <!-- END OF ENGLISH LANGUAGE -->
Curtiss Greveson

Curtiss Greveson 0 points

  • 7 years ago

Hi there, It doesn't look like the id="lang" in your perch:if refers to anything contained in it, so it can't be equal to it?

Drew McLellan

Drew McLellan 2638 points
Perch Support

The first red flag is the dashes in the IDs. Only numbers, letters and _ are allowed - this becomes particularly important with repeaters. That might not be the issue, but it could be.

The id="lang" is set elsewhere as it displays multiple languages which works fine so I know it cannot be due to that.

I have also used dashes in other templates too so it seems strange that that could be the problem I have. It may mean that I have to try it without a <perch:repeater> but for ease of use for the user I would have hoped that I could include the repeaters in there

Drew McLellan

Drew McLellan 2638 points
Perch Support

I can't rule it out if you're experiencing strange behaviour.

Your template looks fairly confused. Did you mean to put the before and after sections within the repeater?

The before and after regions aren't in the repeater region. I will try using an underscore in those id sections though and see if that brings me any joy