I have a couple Low Variables I'm using similar to the traditional embed
template method. This variable has query
module tag to find prev/next entry, but since it's within the channel
tag I'm having issues getting the early parsed LV code to output the correct info - which I thought would take care of it.
So I then thought "why don't I take the query
tag code and create a new LV that is parsed earlier than it's parent LV.
I'm pretty sure this is a parsing stage issue. So I was wondering if this is even possible since the LV is inside the channel
tag? I also moved around the variables to different LV groups to change the parsing sequence, but that didn't work.
My coded simplified is like this:
{exp:channel:entries
channel="case_studies"
disable="categories|category_fields|member_data|pagination|trackbacks"
require_entry="yes"
}
...
{lv_tmpl_utility_belt}
...
{/exp:channel:entries}
{lv_tmpl_utility_belt}
:
<div id="utility-belt"{if segment_1 != ""} class="nav-sticky"{/if}>
{exp:switchee variable="{segment_1}" parse="inward"}
{case value=""} {!-- Show Home Utility Bar --}
<ul id="nav-belt-tabs" class="wrapper clearfix">
{exp:low_variables:pair var="lv_home_hero"}
<li{if count == 1} class="active"{/if}><a href="#">{hero_tab}</a></li>
{/exp:low_variables:pair}
</ul>
{/case}
{case default="yes"} {!-- Show Interior Utility Bar --}
<div class="wrapper">
<a class="btn-flat btn-menu"href="#">Navigation Menu</a>
{lv_ee_casestudy_prevnext_entries}
</div>
{/case}
{/exp:switchee}
</div> {!-- /#utility-belt --}
{lv_ee_casestudy_prevnext_entries}
:
{exp:query sql="
SELECT
url_title,
title
FROM exp_channel_titles
WHERE url_title < '{segment_3}'
AND channel_id = '3'
AND status = 'open'
ORDER BY url_title
DESC LIMIT 1
"}
<a class="btn-flat btn-prev" href="{url_title}" title="Previous: {title}">Previous Case Study</a>
{/exp:query}
{exp:query sql="
SELECT
url_title,
title
FROM exp_channel_titles
WHERE url_title > '{segment_3}'
AND channel_id = '3'
AND status = 'open'
ORDER BY url_title
ASC LIMIT 1
"}
<a class="btn-flat btn-next" href="{url_title}" title="Next: {title}">Next Case Study</a>
{/exp:query}
{segment_3}
(or other dynamic content) into your query param you're opening a potential SQL injection vulnerability. Check out the Active Record plugin for a safer alternative. – Tom Davies Dec 21 '12 at 22:02AND
? – Siebird Dec 21 '12 at 22:30