Passing the set name to low_reorder via an embed
I want to pass the set name to low_reorder tags via an embed. I am trying to replicate the way I can can pass a channel name ('planning') to a template via the parameter 'about_set' to the standard channel tags. Thus within the template this works:
{preload_replace:channel_name="{embed:about_set}"}
{exp:channel:entries channel="{channel_name}" disable="categories|member_data|pagination" sort="asc"}
......
{/exp:channel:entries}
==============================
Using low_reorder (with a set also called planning) this works:
{exp:low_reorder:entries set="planning" disable="categories|member_data|pagination" sort="asc"}
...
{/exp:low_reorder:entries}
===================================================
But using using low_reorder this does not work:
{preload_replace:set_name="{embed:about_set}"}
{exp:low_reorder:entries set="{set_name}" disable="categories|member_data|pagination" sort="asc"}
...
{/exp:low_reorder:entries}
This displays no entries
===================================================
Any suggestions?
Replies
Low 21 Jan 2013 12:43
Using the third option, can you turn on template debugging? You can look up the actual opening Low Reorder tag there, including parsed {set_name} variable. What does that say?
Can you also copy/paste all lines that mention Low Reorder here?
Peter Stalker 21 Jan 2013 13:33
Thanks for the (startlingly) quick response
This is the full template:
===============================================================
{embed="embeds/html-header" my_page_title="About Jericho" my_location="about"}
{embed="about/sidebar1_about" my_location="about"}
ABOUT JERICHO - PLANNING
Planning
Residents of Jericho now have greater opportunities for shaping the future of this unique area.
{embed="about/about_display" about_set="planning"}
<!-- end .content -->
{embed="about/sidebar2_about"}
{embed="embeds/html-footer"}
<!-- end .content -->
<!-- end .container -->
====================================================
This is the full embed ‘about_display’:
{preload_replace:set_name="{embed:about_set}"}
{exp:low_reorder:entries set="{about_set}" disable="categories|member_data|pagination" sort="asc"}
{title}
{entry_date format='%F %d %Y'}
{if caption != ""} Class Called: Low_reorder
(0.019402 / 4.66MB) -> Method Called: entries
(0.019450 / 4.66MB) Low Reorder: Retrieving set from database
(0.020192 / 4.66MB) Low Reorder: Empty set for set_id 0 / cat_id 0
(0.020221 / 4.66MB) Returning No Results Content
(0.020288 / 4.66MB) -> Data Returned
(0.020320 / 4.65MB) - End Tag Processing -
Peter Stalker 21 Jan 2013 13:36
The message seems to have been truncated. Here's the debug again:
(0.012640 / 4.34MB) Processing Sub Template: about/about_display
(0.012658 / 4.34MB) Retrieving Template
(0.012673 / 4.34MB) Retrieving Template from Database: about/about_display
(0.013388 / 4.34MB) Template Found
(0.013468 / 4.34MB) Template Type: webpage
(0.013491 / 4.34MB) Parsing Site Variables
(0.013523 / 4.34MB) Snippets (Keys): freelancer_version|site_id|site_label|site_short_name|last_segment
(0.013539 / 4.34MB) Snippets (Values): FALSE|1|Jericho Online|default_site|planning
(0.013640 / 4.34MB) Embed Variables (Keys): about_set
(0.013654 / 4.34MB) Embed Variables (Values): planning
(0.013709 / 4.34MB) Parse Date Format String Constants
(0.013730 / 4.34MB) Parse Current Time Variables
(0.013765 / 4.34MB) Parsing Segment, Embed, and Global Vars Conditionals
(0.013978 / 4.34MB) Processing Preload Text Replacements: set_name
(0.014005 / 4.34MB) - Beginning Tag Processing -
(0.014022 / 4.34MB) Parsing Tags in Template
(0.014075 / 4.34MB) Tag: {exp:low_reorder:entries set="{about_set}" disable="categories|member_data|pagination" sort="asc"}
(0.014147 / 4.34MB) Closing Tag Found
(0.014190 / 4.34MB) Processing Tags
(0.014226 / 4.35MB) Module Tag: Low_reorder/entries
(0.014245 / 4.35MB) Including Files for Plugins and Modules
(0.016698 / 4.53MB) Files for Plugins and Modules All Included
(0.017048 / 4.54MB) Beginning Final Tag Data Processing
(0.017068 / 4.54MB) Calling Class/Method: Low_reorder/entries
(0.017261 / 4.54MB) -> Class Called: Low_reorder
(0.019402 / 4.66MB) -> Method Called: entries
(0.019450 / 4.66MB) Low Reorder: Retrieving set from database
(0.020192 / 4.66MB) Low Reorder: Empty set for set_id 0 / cat_id 0
(0.020221 / 4.66MB) Returning No Results Content
(0.020288 / 4.66MB) -> Data Returned
(0.020320 / 4.65MB) - End Tag Processing -
Low 21 Jan 2013 13:40
You're using this for the preload replace code:
Which sets a {set_name} var. But you're using the variable {about_set} in the Low Reorder tag. Use the right varname and you should be good to go.
Peter Stalker 21 Jan 2013 13:52
Well spotted! That did the trick.
Thanks for an excellent product and great support!