Feature: The job list can be paginated 

Description 

The Jobs List content element rendered every job of its job type on one page. It now has a Pagination tab with two fields:

  • Enable pagination, off by default. Off, the list renders every job, as before.
  • Results per page, 10 by default.

With the pagination enabled, the list shows one page of jobs and a navigation to the other pages below it. When georgringer/numbered-pagination is installed, the navigation links at most plugin.tx_academicjobs.pagination.numberOfLinks page numbers around the current one, 5 by default, and marks the pages it leaves out with an ellipsis. Without it, the core pagination links every page. The number is a site setting of the set fgtclb/academic-jobs and a constant of the static template, see Pagination of the job list.

  • A page link carries the page as tx_academicjobs_list[currentPage] and nothing else. The job type and the switch for hidden jobs come from the content element, so every page keeps them.
  • A page beyond the last one shows the last page. A page below one, or a value that is no number, shows the first.
  • A list that fits on one page renders no navigation.

Impact 

  • Nothing changes until an editor enables the pagination on a content element. The existing fields of the content element stay on its first tab, so their stored values keep working.
  • The template Templates/Job/List.html renders one page of jobs and the new partial Job/Pagination.html. The variables {paginator} and {pagination} are assigned only while the pagination is enabled, and {jobs} is still every job of the list. A project that overrides Templates/Job/List.html renders every job and no navigation, even with the pagination enabled, until it takes over the change.
  • A listener of \FGTCLB\AcademicBase\Event\ModifyPluginViewEvent that replaces {jobs} changes what the list renders only while the pagination is off. With it enabled, the list renders the page of the paginator, which is built from the jobs before the event.
  • A project that paginates the list itself, with a FlexForm field of its own or a copy of the list template, should remove it with this update. Editors would otherwise see two pagination switches, and the values stored in the project's own field are not taken over: enable the pagination again on each content element that used it.