kaystrobach/typo3-polyfill-paginateviewhelper

Polyfill for the removed paginate ViewHelper

1.0.2 2023-03-03 13:06 UTC

This package is auto-updated.

Last update: 2024-10-30 02:16:17 UTC


README

Contributors Forks Issues GPL License

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

The projects provides a polyfill for the paginateViewHelper widget, which was deprecated in TYPO3 v10 and finally removed in TYPO3 v11+.

<f:widget.paginate objects="{blogs}" as="paginatedBlogs" configuration="{itemsPerPage: 5, insertAbove: 1, insertBelow: 0, maximumNumberOfLinks: 10}">
    use {paginatedBlogs} as you used {blogs} before, most certainly inside
    a <f:for> loop.
</f:widget.paginate>

One nive thing about the viewHelper was, that it supports pagination up till the database level:

In the above examples, it looks like {blogs} contains all Blog objects, thus you might wonder if all objects were fetched from the database. However, the blogs are NOT fetched from the database until you actually use them, so the paginate ViewHelper will adjust the query sent to the database and receive only the small subset of objects. So, there is no negative performance overhead in using the Paginate Widget.

Built With

  • PHP
  • TYPO3

(back to top)

Getting Started

Prerequisites

You need a project with a supported TYPO3 Version. Currently this is only TYPO3 Version 11.

Installation

composer require kaystrobach/typo3-polyfill-paginateviewhelper

(back to top)

Usage

<f:widget.paginate objects="{blogs}" as="paginatedBlogs">
   use {paginatedBlogs} as you used {blogs} before, most certainly inside
   a <f:for> loop.
</f:widget.paginate>

(back to top)

Roadmap

Don't use this polyfill to jumpstart new projects. If you are starting a new project follow the Coding guidelines of TYPO3 and use propert current techniques.

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Attention, we will only accept contributions to enhance stability, any changes which modify the behaviour (seen from the fluid side) will be rejected.

(back to top)

License

Distributed under the GPL-2.0-or-later License, as this is a derived work from the TYPO3 core. See LICENSE.txt for more information.

(back to top)

Contact

Kay Strobach - @kaystrobach

Project Link: https://github.com/kaystrobach/typo3-polyfill-paginateviewhelper

(back to top)

Acknowledgments

Use this space to list resources you find helpful and would like to give credit to. I've included a few of my favorites to kick things off!

(back to top)