Summary
I’m unsure if this is a bug or intended behavior but seems a bit weird. When using pdoResources I am fetching a list of entries under a specific container. My container has 8 resources. When &limit=0
and I output to [[+total]] variable, it correctly tells me that I have 8 resources in my result set. However, if I specify a limit, ex: &limit=4
then sure enough, my results are now 4 resources but the [[+total]] variable is still 8.
I am guessing this makes sense as there are still 8 resources found but I am limitting the output to only 4 but reading the documentation on the total variable it reads: “Name of the placeholder for storing the total number of results.” and in the case of &setTotal “Indicates if the total placeholder should be populated with a count of the results.”, so I am expecting [[+total]] to tell me the number of entries in the result that is being output and not what the logic is matching.
In any case, I don’t seem to have a way to get the total number of entries that would be output (when a limit is assigned) that I can see without some custom coding and I feel there should be a variable that does this without customization.
Am I missing something obvious?
Step to reproduce
Try the call with &limit=0
and a &limit=`` that is less than the actual number of entries and you’ll see that the total variable expresses the number of matched entries and not the actual number of entries in the result.
Environment
This is on MODX Cloud running 3.0.2-pl
Thanks!