Forum
Perch Repeater problem
Hi there
I have a list/detail page for employees that outputs just fine - I'm trying to add in a small section which is a bootstrap panel with an accordion inside it - works just fine on it's own (i.e. when not content managed) so I have tried to incorporate it into the template but using a repeater for each accordion header/content section. I have coded it as below, but when I go to edit the record I can't see the elements within the repeater, only a solid grey bar.
the code is here
<div class="panel panel-default" style="margin-top: 30px;">
<div class="panel-heading" role="tab"><h4><img style="margin-top:-5px; margin-right: 10px; width: 30px;" src="images/news.svg"> <perch:content id="newsperson" type="text" label="Name of person entering news items" help="This area is only intended for Nicole" required="false" /> - In The News</h4></div>
<div class="accordion-container">
<perch:repeater id="newssection" label="News">
<h4 class="accordion-header"><perch:content id="accordiontitle" type="text" label="Item Title" /></h4>
<div class="accordion-content">
<perch:content id="accordiondetail" type="textarea" size="xs" label="Item Copy" markdown="true" editor="markitup" />
</div><!-- accordion-content ends -->
</perch:repeater>
</div><!-- accordion-container ends -->
</div><!-- panel panel-default ends -->
Perch: 2.8.31, PHP: 5.6.25-1~dotdeb.7.1, MySQL: 5.6.32, with PDO Server OS: Linux, cgi-fcgi Installed apps: content (2.8.31), assets (2.8.31), categories (2.8.31) App runtimes: <?php $apps_list = array( 'content', 'categories', ); PERCH_LOGINPATH: /perch
I have used the Bootstrap accordion collapse thing on a site with a multi content region and I had to give each section a unique id so the title would trigger the corresponding panel. This was done with perch_item_index https://docs.grabaperch.com/perch/content/templates/unique-ids/ here is my template code if it is any use.
Cheers Greg
Appreciate the reply
I'm using a small accordion called Vallenato which doesn't use IDs just classes so the repeater is only intended for the central expanding portion.
It appears there is something going on as I have used the same feature before with no issue - I transposed exactly the same code into a new, blank template as a test and it is not working - I have removed every element one by one to the base accordion and no joy. Incidentally when I save the record in mnage content I see a flash of the accordion elements - there is an image of what it looks like here:
https://www.meyerpartnership.com/images/repeater.png
Do you get any errors in your browser console?
Hi Drew
No none... a couple of css token warnings - see pic
https://www.meyerpartnership.com/images/console.png
cheers
Ben
Hang on - just realised that I can see the repeater in Safari but not Chrome (which I was working in) - I need to redo the template and check, but I think that might be the issue!
Yes... it's an issue with Chrome
Version 53.0.2785.143 (64-bit)
Might be an extension conflict, soI'll have a test and come back.
Apologies for the hassle!
cheers
Ben
Yes. Adblock Plus is conflicting - when I turn it off the repeater drop down in the CMS works fine.
Many thanks
Ben