I've created a segment variable for brands that shows in the URL. I want to write an {if} statement that looks at the URL segment for brand and then brings back the products that match the playa field for brand. (ie. If the URL segment says BEAM I want to show all BEAM products that have been selected from the Playa filed). How do I go about doing this? Any suggestions?

Here's a very basic example. This doesn't include the code to only show products with the same name as {segment_6}. Any suggestions? I hope this helps.

<!--I only want to show the code below if segment_6 has something-->
{if segment_6 != ""}  
    {exp:store:search channel="products"}
        {exp:store:product entry_id="{entry_id}"}

                <!--I want all of this code to display the products that match segment_6 with the Playa field brand selected in an entry-->
                {exp:playa:children field="brand"}

                <!--this should also display based on the brand in the playa field above-->                                                     


The URL including segment_6. Segment_4 and Segment_5 are comparing prices

  • Please add more context to your question so we can better understand what your trying to accomplish. Post sample code too.
    – Siebird
    Commented Jan 3, 2013 at 17:28
  • I've updated the questions. I hope this helps. Thanks for chiming in. Very much appreciated. Commented Jan 3, 2013 at 18:19
  • Can you add more context for the related channel associated with playa field brand? Does that channel have categories? How are all the BEAM products setup within that channel? Are they all related to a category BEAM?
    – Siebird
    Commented Jan 3, 2013 at 19:00
  • The playa field is just a name (ie. Beam, Electrolux, Dyson, etc.). Each product is put into a category (ie. Portable, Canister, etc.). Each product is also assigned a brand (ie. the playa field with the brand name). Any thoughts? Commented Jan 3, 2013 at 20:05

1 Answer 1


This is a shot in the dark as I'm still confused on how you have everything configured.

You could just pass the {entry_id} in the {exp:playa:children} playa tag and that would give you all related products that that entry created:

{exp:playa:children entry_id="{entry_id}" field="brand"}
  • Sadly... That won't work in this case. I need to have an {if} statement that looks at the playa field (brands) for the products and then looks at the URL. If in segment_6 it says "Beam" it pulls all products that have the "Beam" brand selected from the Playa field. I hope that made sense. Thanks again for your help. Commented Jan 3, 2013 at 21:09
  • Yeah, sorry. Your question is trivial at this point. You'll need to add way more details to your question on the specifics of the channel setup and how the relationships are created. It almost seems to me that you're using playa as a categories alternative. And if that's the case, maybe the playa {exp:playa:sibilings} tag might work.
    – Siebird
    Commented Jan 3, 2013 at 21:42
  • Thanks. Sorry this is so frustrating. I've added some comments to the code and added a screenshot of the URL. Maybe this will help. Commented Jan 4, 2013 at 15:15
  • Is what's in segment 6 the url_title of the brand entry in the brands channel? Commented Jan 5, 2013 at 17:30
  • Hi Jean. Thank you for the response. Segment_6 is just a fake URL. The name that appears in segment_6 is the same name that is in the brands channel. Segment_6 isn't being added by the channel though. I'm just creating a link that includes this segment. I really hope that made sense. Is there a way to display segment_6 from the channel and then call on products that have a specific product that is tagged from the Playa field? Again... Thank you for your time. Commented Jan 5, 2013 at 19:32

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.