I understand how ’offset’ works in getPage - what I am saying is that the ’offset’ property of getPage is conflicting with the ’offset’ property of getResources (both do different things) - if I comment out the aforementioned property in the getPage snippet, then the result set returned by getResources honours any offset value passed to it. If not then we end up with the issue described in replies below where ’offset’ is not honoured.
I would expect getResources to operate with getPages exactly as it does if used independently, would you not?
Thanks for your reply and sorry if I’m being stupid but maybe I don’t understand the term ’Offset’. I’m not trying to be clever of difficult, but want to understand exactly where I’m going wrong.
I was under the impression that Offset in getResources was having the same effect as ’LIMIT offset, a large number’ on the set of results being returned. So I thought that my call to getResources was returning a full set of News Resources from the 6th Resource onwards. I thought these were then being passed to getPage for paging.
I also thought that when using getPage with getResources that the properties specified in the call were those of getResources (’includeTVs’, ’processTVs’ etc). But if getResources and getPage have properties of the same name (offset and limit), how can this work?
Thanks for your patience.
-
MODX Staff
- 10,725 Posts
What could work is having a feature in getPage which would artificially increment the page-driven offsets by a set amount. This would accomplish what you want. It would simply add the specified integer value to the offset that is calculated and sent to the getResources call.
The documentation in rtfm.modx.com doesn’t contain anything, is there documentation available somewhere else?
Thanks!
@OpenGeek: thanks! Is there a debug-option available? My call isn’t outputting anything and I’m not quite sure why...
Hi!
I’m wondering if only getResource supports the usage of getPage. I’d like to use getPage for the following (standard) snippets, too:
But they both seem to provide there own pagination system which is not that powerfully like getPage. Do you know if getPage can be used for these snippets, too?
Add-On to easily manage your multilingual sites:
Babel