The best place to start when you are creating your custom paginable rendering is to investigate Page Content feature. This is the place where Page List rendering is located - it's supporting pagination.
Few things which have to be done:
- controller - you controller should inherit from
PaginableController
and provide pagination configuration. Just investigate PageListController
, everything is there
- repository - your repository which is providing model should take into account how many elements skip and how many take for a certain page (those are params from pagination configuration provided by the controller)
- config entry - this is probably what you are missing, take a look at
Sitecore.XA.Feature.PageContent.config
file of (Sitecore.XA.Feature.Media.config
), you will find there <paginationEnabledRenderings>
element - simply put there your rendering id
This is how this config entry looks for Page List:
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<experienceAccelerator>
...
<!-- List of renderings that support pagination. -->
<paginationEnabledRenderings>
<rendering id="{2E991AA4-4B08-43D2-AD2B-17C11E69A499}" name="Page List"/>
</paginationEnabledRenderings>
...
</experienceAccelerator>
</sitecore>
</configuration>