0

I'm trying to pre-fetch the number of results available per year for a specific category of articles.

The loopee module allows me to loop from current year back to 1999. I would like to show a filter available (possibly with the number of entries available) only if there are results for that specific year and that specific category.

Example:

Sports

2016(5) | 2015(4)

{exp:channel:categories channel="articles" style="linear"}
    <h1>{category_name}</h1>
    {exp:loopee forint="{current_time format="%Y"}" to="1999" by="-1" parse="inward}
        {exp:low_search:filters query="{segment_3}"}
(IF) ONLY SHOW FOLLOWING CODE IF THERE ARE ENTRIES AVAILABLE                
            <span>
                <a href="{low_search:url collection="articles" category="{category_id}" search:anno="{loopee_value}"}">{loopee_value}(X) | </a>
            </span>
(/END IF)
       {/exp:low_search:filters}
    {/exp:loopee}   
{/exp:channel:categories}

1 Answer 1

1

This is not something Low Search can do for you. You generate the form (or links) that contain the parameters to filters. LS uses a combination of native and its own filters, and EE lacks the API to get to just a results count based on those params (ie. Generating context-aware totals per parameter value)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.