Class: PaginationDrop
- Inherits:
-
Liquid::Drop
- Object
- Liquid::Drop
- PaginationDrop
- Defined in:
- app/drops/pagination_drop.rb
Overview
Accessible using the paginate
variable inside a paginate
tag. You can use the paginate
tag to paginate an array of items and then use the paginate
variable inside it to access different values based on the current page. See the below example
Instance Attribute Summary collapse
-
#current_page ⇒ Integer
Returns the current page number.
-
#page_size ⇒ Integer
Returns the maximum number of items in one page.
-
#pages ⇒ Integer
Returns the total numbers of pages.
Instance Method Summary collapse
-
#current_offset ⇒ Integer
Returns the index of the starting item in the current page (0-indexed).
-
#items ⇒ Integer
Returns the total number of items.
-
#next ⇒ PaginationPartDrop
Returns the PaginationPartDrop for the next page if available.
-
#parts ⇒ Array<PaginationPartDrop>
Returns an array of PaginationPartDrop based on the current pagination context.
-
#previous ⇒ PaginationPartDrop
Returns the PaginationPartDrop for the previous page if available.
Instance Attribute Details
#current_page ⇒ Integer
Returns the current page number
#page_size ⇒ Integer
Returns the maximum number of items in one page
#pages ⇒ Integer
Returns the total numbers of pages
Instance Method Details
#current_offset ⇒ Integer
Returns the index of the starting item in the current page (0-indexed).
#items ⇒ Integer
Returns the total number of items
#next ⇒ PaginationPartDrop
Returns the PaginationPartDrop for the next page if available
#parts ⇒ Array<PaginationPartDrop>
Returns an array of PaginationPartDrop based on the current pagination context. Includes the parts for the first page, last page and 2 pages before & after the current page. Also include placeholder parts ('…') if the current page >= 5 or there are more than 3 pages left from the current page to reach the end .
#previous ⇒ PaginationPartDrop
Returns the PaginationPartDrop for the previous page if available