1

Playa experts out there: I thought variable prefix parameter would solve this one, but perhaps I'm misunderstanding how it's intended to be used. Here's what I'm trying to do:

{exp:channel:entries set="prod" dynamic="no" disable="pagination"}
<li class="{if segment_1 == url_title} active{/if} has-dropdown"><a href="{path='{url_title}'}">{title}</a>
    <ul class="dropdown">
    <li class="has-dropdown"><a href="{path='{PROD_CHANNEL_url_title}/docs'}">API Docs</a>
{exp:playa:parents channel="api" field="cf_apis_related_product"}
<ul class="dropdown">
    <li><a href="{path='{PROD_CHANNEL_url_title}/docs/{API_CHANNEL_url_title}'}">{title}</a></li>
</ul>
{/exp:playa:parents}
{/exp:channel:entries}

Is there a namespacing way to get the url title from within the wrapping entries loop WITHIN the playa parents loop?

3

This is what the var_prefix="" parameter is for. Update your code like this.

{exp:channel:entries set="prod" dynamic="no" disable="pagination"}
...
    {exp:playa:parents channel="api" field="cf_apis_related_product" var_prefix="api"}
    <ul class="dropdown">
         <li><a href="{path='{PROD_CHANNEL_url_title}/docs/{api:url_title}'}">{api:title}</a></li>
    </ul>
    {/exp:playa:parents}
{/exp:channel:entries}
2
  • Ahhhh. You are the man, Jeremy. Thank you for setting me straight on that. Worked like a charm. Dec 5 '13 at 14:10
  • Sure thing. Glad to help. Dec 5 '13 at 14:58

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.