2

I have a single entry page with the url_title in segment_3. I want to get all the other entries in that category, but also apply a search filter.

{exp:channel:entries channel="academy-items"
related_categories_mode="yes"
search:audience="Customer-Support"}
{title}<br>
{/exp:channel:entries}

It looks like search doesn't work in this instance. Is there another way to get this data?

1
  • Do you want to get the related entries or all entries of one specific category? Please, improve your question.
    – Sobral
    Jun 26 '13 at 19:59
2

Contrary to EE docs, it appears you can access the search parameter when using related_categories="yes". I just had my syntax wrong.

{exp:channel:entries channel="academy-items"  
related_categories_mode="yes"
custom_fields="yes"
search:a-audience="Customer-Support"}
...
{/exp:channel_entries}
1

Using a conditional instead of search you could:

{exp:channel:entries 
    channel="academy-items"
    related_categories_mode="yes"
    custom_fields="yes"
}
    {if audience == "Customer-Support"}{title}<br>{/if}

    {!-- or the syntax might instead be: --}
    {if "{audience}" == "Customer-Support"}{title}<br>{/if}
{/exp:channel:entries}
1
  • Aha. It's a hack, but it will work. Thanks.
    – 4midori
    Jun 26 '13 at 22:27
1

Is the "audience" field type one of those that the search parameter supports? From the docs:

Only fields of the type “Text Input”, “Textarea”, and “Drop-down Lists” are searched with this parameter.

1
  • Hmm, that's odd. I'm using a checkbox field type, but I thought that was accessible by the search parameter just like drop-down list - I swear it worked before. Looks like I need another solution.
    – 4midori
    Jun 26 '13 at 22:27

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.