0

This is what I want to do: Show data just from a Matrix row whose Playa column is the child that 2 channels (coparents) share.

I have 3 channels: Sizes, Colors, and Price Groups. Sizes has a playa field "cf_price_group_playa" which references Price Group, and Colors has a Matrix field, cf_size_price, with a playa column, that references the channel Price Group as well. I want to pull only the price for this size in the price group that the color I'm currently looking at is in; if I don't search explicitly on that playa column, I get all the matrix rows:

{exp:channel:entries channel="colors"}
    {exp:playa:coparents channel="sizes"  field="cf_price_group_playa"} 
        {cf_size_price search:price_group="THE_SHARED_PRICE_GROUP"}
        {price}
        {/cf_size_price}
    {/exp:playa:coparents}
{/exp:channel:entries} 

I'm clearly doing something wrong and am tripping myself up figuring it out. It seems so clear, the relationship among these channels, but I'm not getting the front-end bit right. I appreciate insight from the Playa gurus here!

1 Answer 1

0

got it! it's all in the var_prefix'ing, on both the playa field AND the playa parents field:

{exp:channel:entries channel="colors"}
    {cf_color_price_group_playa var_prefix="group"}   
        {exp:playa:parents channel="sizes" entry_id="{group:entry_id}" var_prefix="size"} 
         {size:cf_size_price search:price_group="{group:entry_id}"}{size:price}{/size:cf_size_price} 
        {/exp:playa:parents}
    {/cf_color_price_group_playa}
{/exp:channel:entries}

this post helped immensely, thanks rob + jason, Playa Parents entry_id using child ids

Your Answer

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

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