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

Support archive

Low Variables - Ordering

Gary Crane 22 Jun 2011 14:10 question, complete

Hello,

I'm having some trouble understanding how to order 'Select Entries'. I've set up a select entries low variable with a drag and drop interface. In my template, I'm parsing the entry_ids through to an embed and trying to get the results to be ordered in the correct sort order, selected within low variables. The correct values are being parsed through but EE is defaulting to the orderby="date" by the looks of things.

Here's a sample of my templates:

{embed="includes/hero_spots" entry="{exp:low_variables:parse var="hero_spots"}"}

And the embed is as follows:
{exp:channel:entries entry_id="{embed:entry}"}
{hero_spot}
<li {if count == '1'}class="first"{/if}><a href="{url}" title="{title}">{title}</a></li>
{/hero_spot}
{/exp:channel:entries}


{hero_spot} is a PT Matrix field type.

Am I going about this all wrong? Is there an easier way to achieve the same result?

Look forward to hearing from you.

Cheers,
Gary

Replies

  1. Low 22 Jun 2011 14:17

    Hey Gary,

    There is actually a quite simple way to achieve this. As long as the entry ids for the Select Entry variable type are separated by a pipe line | and Early Parsing is turned on for that variable, you can use it directly as a parameter for the {exp:channel:entries} tag. If you want to make sure the order is adhered, use the fixed_order parameter, like this:

    {exp:channel:entries fixed_order="{hero_spots}"} 
    ...
    {/exp:channel:entries}

  2. Gary Crane 22 Jun 2011 15:26

    Blimey, that was easy. I haven't used fixed_order before, so it was completely off of my radar. All working perfectly now.

    Thanks for your help Low :-)

    Cheers,
    Gary