WebsiteBaker Support (2.13.x) > Modules
OneForAll AnyItems snippet - skip first 1, 2 or 3 items?
(1/1)
CodeALot:
I'd like to use the OneForAll Anyitems where it reads the records of a OFA section but skips the first X items. Any tips on how to achieve that? Maybe another parameter to tell Anyitems to do that?
sternchen8875:
i think, its a easy job, but i cannot test it
i add a 4th parameter and call it offset. offset specifies, how many records to skip from the beginning of a result set before starting to return the data
the other parameters
section_id - the section_id ;-)
limit - How many items do you want to show?
order - true == ASC, false == DESC
some examples
the first 3 items
--- Code: ---oneforall_anyitems(123, 3);
--- End code ---
or
--- Code: ---oneforall_anyitems(123, 3, true, 0);
--- End code ---
the next 3 items, but not item #1 - #3
--- Code: ---oneforall_anyitems(123, 3, true, 3); // LIMIT 3, OFFSET 3
--- End code ---
only item #5
--- Code: ---oneforall_anyitems(123, 1, true, 4); // LIMIT 1, OFFSET 4
--- End code ---
i hope, it works
CodeALot:
Works! Thanks a lot :-)
Navigation
[0] Message Index
Go to full version