0

I am having a bit of trouble with a relationshop field nested inside a grid.

I have the following data structure.

|-Products
|--product_where_to_buy (relationship field for partners)

|-Partners
|--partner_retail_urls (grid field)
|----product (relationship field with products)
|----url (url to purchase page)

What I want to do is filter the partner retail urls by product but it doesn't work no matter what I try.

This returns all results.

{product_where_to_buy status="open|closed"}
    {product_where_to_buy:partner_retail_urls search:product:title="product name"}
        <li><a href="{product_where_to_buy:partner_retail_urls:url}">{product_where_to_buy:title}</li>
    {/product_where_to_buy:partner_retail_urls}
{/product_where_to_buy}

This crashes the template parser

{product_where_to_buy status="open|closed"}
    {product_where_to_buy:partner_retail_urls}
        {if product_where_to_buy:partner_retail_urls:product:title == "product name"}
        <li><a href="{product_where_to_buy:partner_retail_urls:url}">{product_where_to_buy:title}</li>
        {/if}
    {/product_where_to_buy:partner_retail_urls}
{/product_where_to_buy}

Error

You have an invalid conditional in your template. Please review your conditionals for an unclosed string, invalid operators, a missing }, or a missing {/if}.

Parser State: Unexpected ‘href’ (VARIABLE); expected RD in Template “products/index” on line 3.

Am I missing something or am i just going about it the wrong way?

-1

It looks as if your code is missing the closing </a> tag.

1
  • Correct it's missing, but that won't cause a parse issue. – Peter Lewis Oct 26 '14 at 11:24

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.