get the total count of a collection
  • I am setting up specific pagination display for a collection. This is my v:collection code

    <v:collection path="gallery" paginate="24" id="items" previous="previous_link" next="next_link">
    <v:img path="image" width="130" height="130" />

    it needs to display "page 1 of 4", and in order to do that, I need to get the total number of items in the "gallery" collection. How would I do that?

  • 2 Answers sorted by
  • You can get this in PHP by doing <v?=ceil(verb("gallery")->totalMatches()/24)?>

  • That'll give you the "4" in your Page 1 of 4 string.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

In this Discussion