1

I'm trying to do something incredibly simple yet it just won't work and I'm getting frustrated. I have a list of staff members in a Matrix field. Upon selecting a staff member the user is taken to a new template with a detailed bio of that member. I'm using URL segments to pass the row_id of the selected staff member to the bio template but when clicked nothing is displayed. If I manually enter the row_id it works fine which leads me to believe that Matrix does not work with the URL segment variables? Here is the code I'm using:

Page with list of staff members:

{exp:channel:entries channel="staff"}   
    {staff_members}                     
     <a href="{path='templates/bio/{row_id}'}">
    {/staff_members}
{/exp:channel:entries}

Detailed Staff Template

{exp:channel:entries channel="staff"}
    {staff_members row_id="{segment_3}"}
        {staff_bio}
    {/staff_members}
{/exp:channel:entries}

Is this not possible with Matrix or am I missing something really obvious?

0

It is most likely that {exp:channel:entries} tag tries to treat your row_id in URL as entry_id and hence returning no results.

The solution would be to use dynamic="no" parameter and specify what URL segment contains entry url_title/entry_id

{exp:channel:entries dynamic="no" url_title="{segment_2}"}
{staff_members row_id="{segment_3}"}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.