All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

New EE relationships inside low_reorder:entries

Paul 21 Jun 2013 17:54 problem, rejected

Hi

For some reason I can't seem to get relationships to work on EE2.6.1 inside an {exp:low_reorder:entries} tag.

Fails:

{exp:low_reorder:entries set="resorts"}
{resort_town}
<p>{resort_town:title}</p>
{/resort_town}
{/exp:low_reorder:entries}


Works:

{exp:channel:entries channel="resorts" dynamic="no"}
{resort_town}
<p>{resort_town:title}</p>
{/resort_town}
{/exp:channel:entries}


Any ideas?

Replies

  1. Low 22 Jun 2013 14:36

    Can't seem to replicate. What are your LR and PHP versions?

  2. Paul 22 Jun 2013 15:43

    PHP 5.3.8 and LR 2.1.3

  3. Paul 22 Jun 2013 15:57

    Bear with me a sec, just discovered something. Going to test.

  4. Paul 22 Jun 2013 16:10

    Firstly, my apologies for not testing the code completely cleanly. Since I've done that I've found the real problem.

    I'll smack myself over the head for wasting your time.

  5. Paul 22 Jun 2013 16:29

    BTW, on a related note, {country:title} doesn't work in this case. It appears that using a variable in a second loop that wasn't in the first will fail.


    {exp:low_reorder:entries set="resorts"}
    {resort_town}
    <p>{country:url_title}</p>
    {/resort_town}
    {resort_town}
    <p>{country:title}</p>
    {/resort_town}
    {/exp:low_reorder:entries}


    Works if {country:title} is added to the first loop. Perhaps LR is relying on the contents of the session variable without re-querying when a non-existing variable is used?

  6. Paul 22 Jun 2013 16:40

    Quite an edge case so I'm not surprised it wasn't considered. It's just that in my case I'm repeating the resort_town loop rather than wrap it around a matrix loop:

    Stripped code:

    {exp:low_reorder:entries set="resorts"}

    {resort_town}
    <p>{country:url_title}</p>
    {/resort_town}

    {resort_gallery}
    {gallery_image}
    {/resort_gallery}

    {resort_town}
    <p>{country:title}</p>
    {/resort_town}

    {/exp:low_reorder:entries}


    Wrapping does appear to work, though I wonder if that can be relied upon.

  7. Low 24 Jun 2013 05:49

    Hi Paul,

    Still cannot replicate this behaviour you describe in your last post. Are you sure this is limited to only the Low Reorder Entries tag?

  8. Paul 25 Jun 2013 16:13

    True, it's the same with a channel:entries tag. I just thought that maybe LR could get all the data cached, but I suppose it just passes the request over to channel:entries.

  9. Low 26 Jun 2013 17:45

    Yeah, so in that case, it's better to approach EllisLab with this...