Forum

Thread tagged as: Question, Problem

Filtering Fields in a Collection Template Based on Slug in Path?

I have a page that is displaying a Collection called Application.

In the collection template I want to output the relevant fields based on a slug in the current page path (the slug is named "techslug"). Is this possible and how do you do it if so?

This is what I have so far but it doesn't seem to filter the fields?

         <perch:if id="app_desc_biologics_card" value="{techslug}" match="contains">
            <perch:content type="textarea" id="app_desc_biologics_card" markdown="true" html="true" editor="markitup" />
         </perch:if>
Philip Gwynne

Philip Gwynne 1 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Does techslug appear in <perch:showall /> ?

Yes, techslug does appear in <perch:showall />.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Does the value of techslug appear as a distinct word within the app_desc_biologics_card field?

Sorry Drew, we were filtering on the wrong ID!

It should have been this, which is now working: <perch:if id="techslug" value="{techslug}" match="eq">