Crocoblock/suggestions

Current Query Item Count

theheadphonelist opened this issue · 4 comments

I have been unable to find a "current query result number" that will enable me to:

  1. Number query results for a regular query
  2. Base dynamic visibility on the current query item count

Please add a query variable to the query results for regular query types (I did see a video on how to create an SQL query and use pagination to get counts, but I still believe it is the total count).

It could be named something like [query_current_count] with a value of 1 more than the stdClass Object array result number.

Thanks!

If I missed this functionality, my apologies.

could you please elaborate more? I don't really get the gist of your issue

I am looking for a macro or variable that will tell me what the current count of the query is on a listing grid page being called by a query.

Example 1:
If there are 3 repeater entries, I want to be able to display the current repeater count.

  1. repeater_value1
  2. repeater_value2
  3. repeater_value3

Example 2:
Same repeater with 3 values, but I want to have conditional logic for formatting purposes, which is why I am using a listing grid vs. the dynamic repeater widget.
repeater_value1 [text widget] repeater_value2 [text widget] repeater_value3 [text widget hidden]

Example 3:
I have posts queries that are ordered by a specific field that represents the score. I want to be able to get the index value of each post within the query and display it.
In a list:
post_title1 1 of total_query_count for category_a
post_title2 2 of total_query_count for category_a
etc...

On a post page:
post_title1
1 of total_query_count for category_a
3 of total_query_count for category_b
9 of total_query_count for category_c

Does this make sense?

Well there is a Query Results Count Dynamic Tag https://i.imgur.com/wUWmIEn.png and also a macro https://i.imgur.com/iJH3Olb.png

Fore Example 3 there is a free plugin here https://crocoblock.com/freemium/tools/ https://i.imgur.com/oIqeJEP.png

The last example is not achievable out of the box as of now, but you may try writing an Advanced SQL query that returns the result you need

Well there is a Query Results Count Dynamic Tag https://i.imgur.com/wUWmIEn.png and also a macro https://i.imgur.com/iJH3Olb.png
This returns the total count of the query, not the current item count. i.e. 10 results total, not item n of 10. I tried using the custom values, but it did not return the current count.

Fore Example 3 there is a free plugin here https://crocoblock.com/freemium/tools/ https://i.imgur.com/oIqeJEP.png
Looks like the listing counter will work for the display counter. I will have to try to see if it will work for conditional formatting using a shortcode.

The last example is not achievable out of the box as of now, but you may try writing an Advanced SQL query that returns the result you need
Understood

Thanks!