2

I'm having trouble getting this error resolved:

.... is using the deprecated {child:url_title} tag. Please use Playa’s var_prefix parameter instead

This is my code:

{exp:playa:parents field="artist-relationship-playa" orderby="artworks-order" sort="asc"}
        {if "{show-on-website}" == "y"}
            <a href="{site_url}artists/{child:url_title}/{url_title}">{embed="artists/_artist-artworks-embed" entry_id="{entry_id}"}</a>
        {/if}
{/exp:playa:parents}

This code is inside a channel tag pair.

What should I change about this code to make is work?

4
  • Which version are you using? 4.4 had a lot of bug, 4.4.1 has just been released
    – pvledoux
    Apr 17, 2013 at 15:05
  • I'm using 4.4. Will upgrade now. However my errors have nothing to do with this. It's just my lack of knowledge.
    – JonkBok
    Apr 17, 2013 at 16:10
  • 1
    This is the code that got it to work: {exp:playa:parents field="artist-relationship-playa" orderby="artworks-order" sort="asc" var_prefix="artworks"} {if "{artworks:show-on-website}" == "y"} <a href="{site_url}artists/{url_title}/{artworks:url_title}">...</a> {/if} {/exp:playa:parents} Just so that others want to know how it works. When using var_prefix, all variables inside that playa tag pair are rendered as if they where not. Only if you prefix your variable with your var_prefix value, will it be rendered as it would previously... get it :)
    – JonkBok
    Apr 17, 2013 at 16:30
  • 1
    That's a beautiful explanation, Louis. I'm glad you figured it out! It'd be awesome if you posted this as an answer and accepted it. And thank you for following up :)
    – Lisa
    Apr 17, 2013 at 16:33

1 Answer 1

2

Ah, I get how it works now. This is the code that got it to work:

{exp:playa:parents field="artist-relationship-playa" orderby="artworks-order" sort="asc" var_prefix="artworks"}
      {if "{artworks:show-on-website}" == "y"}
         <a href="{site_url}artists/{url_title}/{artworks:url_title}">...</a>
      {/if}
{/exp:playa:parents}

Just so that others want to know how it works. When using var_prefix, all variables inside that playa tag pair are rendered as if they where not. Only if you prefix your variable with your var_prefix value, will it be rendered as it would previously... get it :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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