Loop Links question

General ShopSite user discussion

Loop Links question

Postby ametron » Sat Feb 02, 2019 5:02 am

I am using Boot-Two page template and have an extra page field to filter the first group of page links
Works except it creates a div for each page link that is skipped
( <!-- Empty field [Field3] --> </div></div><div class="link col-md-3 col-sm-4 col-xs-6 nopad"><div>)
How can I fix ?
Thanks
Douglas

[--DEFINE LINK_TO_PAGE--][-- VAR.NeedLink "yes" --]
[-- IF VAR.link_type "Brand" --]
[-- IF PAGE.Field3 "yes" --]
[-- IF PAGE.LinkGraphic --][-- VAR.NeedLink "no" --]<a class="sublinkimg[-- IF PAGE.TextWrap "Off" --] block[-- END_IF --]" href="[-- OUTPUT_DIRECTORY_URL --]/[-- PAGE.FileName --]" title="[-- IF PAGE.Title --][-- PAGE.Title --][-- ELSE_IF PAGE.LinkName --][-- PAGE.LinkName REMOVE_HTML --][-- ELSE --][-- PAGE.Name REMOVE_HTML --][-- END_IF --]">[-- PAGE.LinkGraphic ONLY_ALT_TAG --]</a>[-- END_IF --]
[-- IF PAGE.LinkName --][-- VAR.NeedLink "no" --]<a class="sublink[-- IF PAGE.TextWrap "Off" --] block[-- END_IF --]" href="[-- OUTPUT_DIRECTORY_URL --]/[-- PAGE.FileName --]" title="[-- IF PAGE.Title --][-- PAGE.Title --][-- ELSE --][-- PAGE.LinkName REMOVE_HTML --][-- END_IF --]">[-- PAGE.LinkName --]</a>[-- END_IF --]
[-- IF VAR.NeedLink "yes" --]<a class="sublink[-- IF PAGE.TextWrap "Off" --] block[-- END_IF --]" href="[-- OUTPUT_DIRECTORY_URL --]/[-- PAGE.FileName --]" title="[-- IF PAGE.Title --][-- PAGE.Title --][-- ELSE --][-- PAGE.Name REMOVE_HTML --][-- END_IF --]">[-- PAGE.Name --]</a>[-- END_IF --]
[-- IF PAGE.LinkText --]<span[-- IF PAGE.TextWrap "Off" --]class="block">[-- ELSE --]> &nbsp; [-- END_IF --][-- PAGE.LinkText --]</span>[-- END_IF --]
[-- END_IF --]
[-- ELSE --]
(omitted)
[--END_DEFINE LINK_TO_PAGE--]


################################################################## Loop Links
[-- IF PAGE.FileName "index.html" --]
[-- VAR.link_type "Brand" --]
[-- IF PAGE.NumLinks GT 0 --]
[-- IF PAGE.LinkColumns "One Column" --][-- VAR.LinkColumns "onecolumn" --][-- VAR.LinkColumnClass "" --]
[-- ELSE_IF PAGE.LinkColumns "Two Columns" --][-- VAR.LinkColumns "twocolumns" --][-- VAR.LinkColumnClass "col-sm-6 nopad" --]
[-- ELSE_IF PAGE.LinkColumns "Three Columns" --][-- VAR.LinkColumns "threecolumns" --][-- VAR.LinkColumnClass "col-md-4 col-sm-6 nopad" --]
[-- ELSE_IF PAGE.LinkColumns "Four Columns" --][-- VAR.LinkColumns "fourcolumns" --][-- VAR.LinkColumnClass "col-md-3 col-sm-4 col-xs-6 nopad" --]
[-- ELSE --][-- VAR.LinkColumns "fivecolumns" --][-- VAR.LinkColumnClass "md-5-col col-sm-3 col-xs-4 nopad" --]
[-- END_IF --]
<div class="products [-- VAR.LinkColumns --] [-- VAR.Borders --] clearafter">
[-- LOOP LINKS --]<div class="link [-- VAR.LinkColumnClass --]"><div>
[-- LINK Boot-Two.sst --]</div></div>[-- END_LOOP LINKS --]
</div>
[-- END_IF --]

[-- ELSE --]
(omitted)
ametron
 
Posts: 24
Joined: Sun Apr 25, 2010 3:15 am
Location: California

Re: Loop Links question

Postby cyoung » Thu Feb 07, 2019 12:14 pm

Everything between [-- LOOP LINKS --] and [-- END_LOOP LINKS --] will be output for each product. So if you have divs (or any other text or
HTML) that you don't want output for certain products, then you'd need to move it OUT of the [-- LOOP LINKS --]...[-- END_LOOP LINKS --] loop and into the [--DEFINE LINK_TO_PAGE--] section so you can include it in the IF logic so it's not output in the case of page links you want to skip.
cyoung
 
Posts: 79
Joined: Wed Nov 09, 2016 11:01 am

Re: Loop Links question

Postby ametron » Thu Feb 07, 2019 10:26 pm

Thanks, I'll give it a try
ametron
 
Posts: 24
Joined: Sun Apr 25, 2010 3:15 am
Location: California


Return to User Forum

Who is online

Users browsing this forum: No registered users and 9 guests