web-illinois / toolkit

This library provides styles and web components for creating branded UIUC websites.
18 stars 7 forks source link

Pagination component: need optional parameter for starting page number #419

Closed trubach closed 1 year ago

trubach commented 1 year ago

Drupal's built-in pagination system starts its pages at '0' instead of '1', as it's currently set in the pagination component. For the pagination component to work in Drupal, we'll need an additional optional parameter that allows us to set the starting page number.

For example, if there are 13 pages of results, the range of numbers for the pages in the "?page=" parameter would be 0-12. Currently, it assumes it's always 1-13.

mattsharkey commented 1 year ago

The best way to do this is to use a custom JS function for generating URLs. Here's how that might work in Drupal:

https://codepen.io/il-toolkit/pen/bGmmEob