All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Total Results

JS 18 Sep 2011 00:38 question, complete

When using the tag {total_results}, I am getting a string of ones "1111111111" in version 1.05 downloaded from devot-ee. Each one counts as a single result...so "11111" = "5". Is this a bug or am I missing something? Thanks

Replies

  1. Low 18 Sep 2011 19:40

    Hi! For the record, what are the versions of EE and PHP you're running?

  2. JS 18 Sep 2011 20:06

    EE v2.2.2 / PHP 5.2.13

    If you have any other questions, please let me know. Thanks.

  3. Low 18 Sep 2011 20:39

    If you replace the {exp:low_search:results} tag with a regular {exp:channel:entries} tag, does the {total_results} variable work normally?

  4. JS 18 Sep 2011 21:13

    Please tell me what code we should use to list the total results... the 1s were an embed issue... now its repeating the total number of results with the actual total. Ex:

    There are 55555 results to your query.

  5. Low 18 Sep 2011 21:17

    It should work identically to the {exp:channel:entries} tag, so you could use the {total_results} or {absolute_results} variables.

    What's the code you're using now?

  6. JS 18 Sep 2011 21:30

    Currently this is the code:

    Your search for {exp:low_search:keywords query="{segment_2}"} received {exp:low_search:results query="{segment_2}"}{total_results}{/exp:low_search:results} results.

    So, it repeats the correct total. Wouldn't this type of feature require a special tag like the keyword tag so it won't try to repeat? This is the special tag used by EE's native search feature: {exp:search:total_results}{total_results}{/exp:search:total_results}

  7. Low 18 Sep 2011 21:35

    I'd need to see the template context, but you could try something like this:

    {exp:low_search:results query="{segment_2}"} 
    {if count == 1}
    Your search for {exp:low_search:keywords query="{segment_2}"} received {total_results} results.
    {/if}
    ...
    {/exp:low_search:results}

  8. JS 18 Sep 2011 21:43

    Perfect. Thanks Low!