# Pagination auf Custom Page - Wie umsetzen?

**URL:** https://forum.shopware.com/t/pagination-auf-custom-page-wie-umsetzen/53560
**Category:** Programmierung
**Created:** [18. Juni 2018 um 22:07 UTC](https://forum.shopware.com/t/pagination-auf-custom-page-wie-umsetzen/53560 "2018-06-18T22:07:34Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![kanuma](https://avatars.discourse-cdn.com/v4/letter/k/ce7236/32.png) [@kanuma](https://forum.shopware.com/u/kanuma)
#### Post date: [18. Juni 2018 um 22:07 UTC](https://forum.shopware.com/t/pagination-auf-custom-page-wie-umsetzen/53560/1 "2018-06-18T22:07:34Z")

</div>

Moin,

Ich schreibe gerade ein Plugin für eine Bewertungsübersicht, dass ich auch frei auf GitHub zur verfügung stelle.

Leider ist es ziemlich blöd, wenn 1432 Bewertungen auf einer Seite ausgegeben werden. Wie kann mann eine Pagination bauen mit den Shopware Boardmitteln ? Oder hat jemand ein Beispiel, an dem ich mich orientieren kann?

Leider konnte ich nichts mit den vorhandenen Posts anfangen. @brettvormkopp‍ hoffe du kannst helfen 🙂

Gruß,

Marc

---

<div class="post-metadata">

### Author: ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)
#### Post date: [19. Juni 2018 um 00:33 UTC](https://forum.shopware.com/t/pagination-auf-custom-page-wie-umsetzen/53560/2 "2018-06-19T00:33:52Z")

</div>

Also die pagination von Shopware ist mega hässlich. Da gibt es aber ein Plugin „logarithmic pagination“. Sowas kann man ja nachbauen. Ich habe von Seite 1-5 werden alle pages angezeigt, und ab 6 dann "logarithmisch’, wer auch immer sich diesen Begriff ausgedacht hat. Und im Bewertung plugin muss dann eben ein limit eingearbeitet werden. Ich guck morgen mal nach ein paar codeschnipseln.

---

<div class="post-metadata">

### Author: ![kanuma](https://avatars.discourse-cdn.com/v4/letter/k/ce7236/32.png) [@kanuma](https://forum.shopware.com/u/kanuma)
#### Post date: [19. Juni 2018 um 14:09 UTC](https://forum.shopware.com/t/pagination-auf-custom-page-wie-umsetzen/53560/3 "2018-06-19T14:09:05Z")

</div>

Würde mich sehr freuen, wenn du ein schönes Beispiel hättest, dass ich übernehmen / nachbauen könnte für das Projekt&nbsp; ![Shopware](https://forum.shopware.com/plugins/CKEditor/plugins/smiley/images/shopware.png "Shopware") ![Thumb-Up](https://forum.shopware.com/plugins/CKEditor/plugins/smiley/images/thumb-up.png "Thumb-Up")

---

<div class="post-metadata">

### Author: ![simkli](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/simkli/32/13124_2.png) [@simkli](https://forum.shopware.com/u/simkli)
#### Post date: [19. Juni 2018 um 14:29 UTC](https://forum.shopware.com/t/pagination-auf-custom-page-wie-umsetzen/53560/4 "2018-06-19T14:29:18Z")

</div>

Naja, du übergibst einfach einen GET-Parameter names “page” (oder “p”). Dann wählst du noch eine Anzahl Bewertungen pro Seite n.  
Danach einfach die SQL-Query entsprechend limitieren

```
SELECT * FROM ... LIMIT n OFFSET p*n 

```

Dann brauchst du noch, wie viel Seiten es insgesamt gibt: ceil(#AnzahlReview/n).

Und die Pagination im Frontend stellst du wie folgt dar: [shopware/action-pagination.tpl at 5.4 · shopware/shopware · GitHub](https://github.com/shopware/shopware/blob/5.4/themes/Frontend/Bare/frontend/listing/actions/action-pagination.tpl)

Das SQL natürlich nicht 1:1 so übernehmen, sondern die entsprechenden Schnittstellen (DBAL-Querybuilder verwenden, etc.)

Vielleicht verstehe ich die Frage nicht 100%, aber da es direkt mit deinem SQL-Statement zu tun hat, gibt es da keine weiteren Boardmittel.

Viele Grüße

---

<div class="post-metadata">

### Author: ![kanuma](https://avatars.discourse-cdn.com/v4/letter/k/ce7236/32.png) [@kanuma](https://forum.shopware.com/u/kanuma)
#### Post date: [19. Juni 2018 um 16:00 UTC](https://forum.shopware.com/t/pagination-auf-custom-page-wie-umsetzen/53560/5 "2018-06-19T16:00:48Z")

</div>

Ich hab es schon geschafft, mir hat&nbsp;dieses video sehr geholfen um das Prinzip zu verstehen:

> **[Create Pagination in PHP and MySQL](https://www.youtube.com/watch?v=gdEpUPMh63s)**
>
> source code: https://github.com/simonjsuh/pagination-in-phpJoin my Facebook group to learn more about web development - https://www.facebook.com/groups/12662...

Grüße,

Marc
