Forum
Collection items in Shop product
Hello, I have no success showing collection items in a products template. My collection holds testimonials with a "text" and a "name" field
<div class="socialproof socialproof__base">
<div class="socialproof__texto">
<perch:content id="text" type="textarea" size="s" label="Texto" />
</div>
<div class="socialproof__nombre">
<perch:content id="name" type="text" label="Nombre" title="true"/>
</div>
</div>
in my product.html I'm doing this:
<perch:before>
<ul class="testimonios__list">
</perch:before>
<li class="testimonio__item">
<perch:related id="testimonio" collection="Social Proof" label="Testimonio" scope-parent="true">
<p><perch:content id="parent.name" /></p>
</perch:related>
</li>
<perch:after>
</ul>
</perch:after>
but the field I create stays empty.
Can you see what I'm doing wrong?
Thanks a lot
Have you enabled debug so you can see what is being returned? That would be the first step.
I did and don't think there's anything useful there
Does the field appear on the edit form?
It does but when clicking on the input nothing happens. I saw in your video on relationships that it should display the available collection fields like a "select" field. In my case I just get a text input and whatever I type inside I get "No results match".
Just to establish what is working and what isn't - are normal relationships between collections working as expected?
I created a 2nd Collection to test and realised that normal relationships don't work either!
The new collection template is
and the debug from this collection's admin page:
Must be something I'm doing wrong but can't find it :(
Apparently relationships don't like compound collection IDs. So "Social Proof" didn't work while "Testimonials" did. Maybe it's worth to add to the docs if designed to work like this.
That's not intended - we'll take a look at it.