Allowing the user to update a CraftCMS pagination limit with listing filter options I am building a pagination layout limiting the content to 10 because, well, it makes sense to break down large amounts of content to smaller chunks.

But as there is so much, a user might want to toggle how many they want to see. But because the pagination limit is done in the twig variables, is there a built in method for updating this on user interactions?

Standard CraftCMS pagination code:

{% paginate craft.entries.section(entry.slug).order('postDate desc').with: ['image'].limit(10) as pageInfo, pageItems %}


Cheers
You could create a form/a link with the limit and add the parameter in your $_GET request or as a segment to your url. This is just an example how to use it.

How many Entries would you like to get?
&lt;a href="/?limit=10"&gt;10&lt;/a&gt;
&lt;a href="/?limit=20"&gt;20&lt;/a&gt;
&lt;a href="/?limit=30"&gt;30&lt;/a&gt;


Then you can fetch this parameter

{% set limit = craft.request.getQuery('limit', 10) %}
{% paginate craft.entries.section(entry.slug).order('postDate desc').with: ['image'].limit(limit) as pageInfo, pageItems %}


Of course you have to attach this parameter to your paginate links as well

{% if pageInfo.prevUrl %}&lt;a href="{{ pageInfo.prevUrl }}?limit={{ limit }}"&gt;Previous Page&lt;/a&gt;{% endif %}


There are definitely better solutions but they require more time and more effort and a plugin/php but this would be the easiest solution