1

I am trying to control the order of my products using Low Variables (2.3.4) and Playa (4.3.3).

I have a Low Variable of type Playa name lv_product_order which I use to output the ids in the following manner.

{exp:low_variables:parse var="lv_product_order"}{entry_id},{/exp:low_variables:parse} 

This gives me entry ids that I selected in the correct order, also including hte additional unnecessary comma. So I tried to than include this in my channel entries loop in the following manner.

    {exp:channel:entries 
        channel="product" 
        disable="member_data|pagination|category_fields" 
        dynamic="off" 
        fixed_order="{exp:low_variables:parse var="lv_product_order"}{entry_id},{/exp:low_variables:parse}"}

This results in the all products being output - even though I only selected a few in the LV Playa field, and order is obviously not preserved either. Template debugging displays the following tag output:

{exp:channel:entries channel="product" disable="member_data|pagination|category_fields" dynamic="off" fixed_order="M40o93H7pQ09L8X1t49cHY01Z5j4TT91fGfr"}

Where does the following hash come from? I expect this to be a list of IDs.

M40o93H7pQ09L8X1t49cHY01Z5j4TT91fGfr

I have the field set to early parsing so I figured this would parse before the channel entry tag. Is this a parsing order issue?

Any help would be greatly appreciated. Thanks, Thomas

5
  • Do you have this variable set to "on" for early parsing?
    – Lisa
    May 17, 2013 at 19:46
  • @LisaWess Yes, is that correct?
    – Thomas
    May 17, 2013 at 19:47
  • I haven't worked with the LVs enough to be certain; but I'd try toggling it off. What you're seeing there is a template marker that is not being replaced in later parsing in the template. so switching it off may give you some relief. Also - what version of EE are you on?
    – Lisa
    May 17, 2013 at 19:49
  • @LisaWess I am using EE 2.5.3. Unfortunately turning off early parsing produces the same result.
    – Thomas
    May 17, 2013 at 19:55
  • 2
    Thomas - does this solution work for you? stackoverflow.com/questions/13101138/…
    – Lisa
    May 17, 2013 at 20:08

2 Answers 2

2

This Stack Overflow post has an answer from Low that should work for you.

Here's how: make sure early parsing is enabled for that variable, and then use the variable syntax instead of the tag syntax:

{exp:channel:entries channel="groups" entry_id="{lv-home-groups}"}
code here
{/exp:channel:entries}
1
  • Works great, Thanks Lisa. Only bummer was losing the multi-selection and status color features provided in Playa. Really appreciate your help!
    – Thomas
    May 17, 2013 at 20:40
0

Try an embed. In your main template put the embed code to a newly created embed template (in my example, it's 'embed_product_list').

{embed="template-group/embed_product_list" product_ids="{lv_product_order}"}

Then in the embed_product_list template, your opening tag would be:

{exp:channel:entries 
    channel="product" 
    disable="member_data|pagination|category_fields" 
    dynamic="no" 
    fixed_order="{embed:product_ids}"}
2
  • I thought Low Variables was often used to reduce performance issues with embeds. Won't this create an issue?
    – Thomas
    May 17, 2013 at 17:58
  • Also, this is not working, I have tried to implement, yet the value that is passed into the fixed_order parameter from the playa field is an array containing the id number as well as the url title and the title.
    – Thomas
    May 17, 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.