Hi,
The following works, but Test Loop (Header) shows up on page 2 even if there is no links available. I assume the same would happen for Test Loop Two (Header).
Questions:
1. Can I stop the Header from showing when no links available.
2. Can I shorten the code and obtain the same results.
<%if link_results_loop.length~%>
<h3>Test Loop:</h3><br>
<%if title_loop.length%>
<%~set formatted_title = Links::Utils::format_title($title_loop, separator => $category_separator, no_escape_separator => $no_escape_category_separator, include_home => 0, link_type => 1)%>
<p class="category"><%if highlight and query%><%Links::Tools::highlight($formatted_title, $query)%><%else%><%formatted_title%><%endif%></p>
<%~endif%>
<%loop link_results_loop~%>
<%if test eq '3'~%>
<%include link.html%>
<%~endif%>
<%~endloop%>
<br>
<%if link_results_loop.length~%>
<h3>Test Loop Two:</h3><br>
<%if title_loop.length%>
<%~set formatted_title = Links::Utils::format_title($title_loop, separator => $category_separator, no_escape_separator => $no_escape_category_separator, include_home => 0, link_type => 1)%>
<p class="category"><%if highlight and query%><%Links::Tools::highlight($formatted_title, $query)%><%else%><%formatted_title%><%endif%></p>
<%~endif%>
<%loop link_results_loop~%>
<%if test eq '5' or test eq '4' or test eq '2' or test eq '1' or test eq '0'~%>
<%include link.html%>
<%~endif%>
<%~endloop%>
The following works, but Test Loop (Header) shows up on page 2 even if there is no links available. I assume the same would happen for Test Loop Two (Header).
Questions:
1. Can I stop the Header from showing when no links available.
2. Can I shorten the code and obtain the same results.
<%if link_results_loop.length~%>
<h3>Test Loop:</h3><br>
<%if title_loop.length%>
<%~set formatted_title = Links::Utils::format_title($title_loop, separator => $category_separator, no_escape_separator => $no_escape_category_separator, include_home => 0, link_type => 1)%>
<p class="category"><%if highlight and query%><%Links::Tools::highlight($formatted_title, $query)%><%else%><%formatted_title%><%endif%></p>
<%~endif%>
<%loop link_results_loop~%>
<%if test eq '3'~%>
<%include link.html%>
<%~endif%>
<%~endloop%>
<br>
<%if link_results_loop.length~%>
<h3>Test Loop Two:</h3><br>
<%if title_loop.length%>
<%~set formatted_title = Links::Utils::format_title($title_loop, separator => $category_separator, no_escape_separator => $no_escape_category_separator, include_home => 0, link_type => 1)%>
<p class="category"><%if highlight and query%><%Links::Tools::highlight($formatted_title, $query)%><%else%><%formatted_title%><%endif%></p>
<%~endif%>
<%loop link_results_loop~%>
<%if test eq '5' or test eq '4' or test eq '2' or test eq '1' or test eq '0'~%>
<%include link.html%>
<%~endif%>
<%~endloop%>