1

EE 2.7.2 Playa 4.4.5

I have two playa fields in my Recipes channel field group.

One is called similar_recipes, which relates to other entries within the recipes (which happens to be the channel this form is posting to).

The other is related_products.

{similar_recipes}
    {if count > 0}<h3>Similar Recipes</h3>{/if}
    <p>
        {recipe_image}
            <a href="/recipes/view/{url_title}" title="{title}"><img src="{image:url:small}" alt="{title}"></a>
        {/recipe_image}

        <a href="/recipes/view/{url_title}" title="{title}">{title}</a>
    </p>
{/similar_recipes}


{related_products}
    {if count > 0}<h3>Related Products</h3>{/if}
    <p>
        {product_image}
            <a href="/products/view/{url_title}" title="{title}"><img src="{image:url:small}" alt="{title}"></a>
        {/product_image}

        <a href="/products/view/{url_title}" title="{title}">{title}</a></p>
{/related_products}

enter image description here

I tried using the dynamic parameter, thinking it may be an issue with the fact I have a playa field that relates to its own entries, but I don't think thats the issue.

As you can see in the attached image, it acts like those fields do not exist in the channel field group.

enter image description here

3

Looks like a variable name conflict. You can use "var_prefix" when this happens. Try something like this:

{exp:playa:children channel="recipe" entry_id="{entry_id}" field="similar_recipes" var_prefix="related" }
    {related:title}
{/exp:playa:children}

http://docs.pixelandtonic.com/playa/templating/module/children.html

2
  • Added entry_id="{entry_id}" to exp:playa:children ... and it worked perfectly, thanks again. – Brad Nov 26 '13 at 14:51
  • You're most welcome... I added entry_id="{entry_id}" to me example code. – Anna_MediaGirl Nov 26 '13 at 16:26

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.