stand alone total search result tag
Is there an total_results tag for low search results that can be used outside the {exp:low_search:results} tag much like this tag {exp:low_search:keywords query="{segment_3}"}?
Is there an total_results tag for low search results that can be used outside the {exp:low_search:results} tag much like this tag {exp:low_search:keywords query="{segment_3}"}?
Replies
Low 9 Oct 2013 10:07
There is not. Mainly due to the fact that Low Search uses both custom and native filters, and the total amount of results is not known until after LS calls the native channel:entries tag. You'll have to use the {absolute_results} var inside the Results tag.
RobPost 9 Oct 2013 11:00
Thanks, that's clear.
I'm stucked with one issue though. The {absolute_results} var returns the number of entries per page while using pagination instead of the total number of entries?
{exp:low_search:results
query="{segment_3}"
limit="10"
disable="member_data"
status="not closed"
}
<!-- results -->
{if count == 1}
{if absolute_results == 1}
<p>{phrase:zoeken_naar} <strong>{low_search_keywords}</strong> {phrase:leverde} <strong>1</strong> {phrase:resultaat_op}. </p>
{if:else}
<p>{phrase:zoeken_naar} <strong>{low_search_keywords}</strong> {phrase:leverde} <strong>{absolute_results}</strong> {phrase:resultaten_op}. </p>
{/if}
{/if}
{if count == 1}<ul class="search_result_list">{/if}
<li class="{switch='even|odd'}">{channel}: <strong><a href="{comment_url_title_auto_path}">{title}</a></strong></li>
{if count == total_results}</ul>{/if}
<!-- paginate -->
{paginate}
{pagination_links}
<ul class="pagination pagination-sm">
{previous_page}<li><a href="{pagination_url}">«</a></li>{/previous_page}
{page}<li class="{if current_page}active{/if}"><a href="{pagination_url}">{pagination_page_number}</a></li>{/page}
{next_page}<li><a href="{pagination_url}">»</a></li>{/next_page}
</ul>
{/pagination_links}
{/paginate}
<!-- no results -->
{if no_results}
<p>
Sorry, your query did not return any results.
Check your spelling or try a different search term.
</p>
{/if}
{/exp:low_search:results}
So in this situation the returned {absolute_results} is 10, which is equal to the limit set, instead of 65 which supposed to be the total # of results.
Low 9 Oct 2013 11:10
Can you try clearing EE's cache?
RobPost 9 Oct 2013 11:20
Stupid me!
Thanks a million