Quantcast
Viewing all articles
Browse latest Browse all 1960

Templates for Joomla! 5.x • Override pagination to show fewer page links

I'm currently developing my own custom template and I've cloned Cassiopeia and began modifying it. My issue is that if there is enough content, the pagination looks like this:
<< < 1 2 3 4 5 6 7 8 9 10 > >>

What I'd like to do is reduce the number of page links so that it looks like this
<< < 1 2 3 4 5 > >>

I found the Joomla Core file that puts the pagination together here:
public_html/library/src/Pagination/Pagination.php

But this is a Joomla Core file and I don't want to alter it, or I'm not sure how to properly override it. If I take Pagination.php and clone it to "public_html/templates/[template_name]/html/" I get a namespace error.

I've also created overrides of the layout files here at:

public_html/templates/[template_name]/html/layouts/joomla/pagination/link.php
public_html/templates/[template_name]/html/layouts/joomla/pagination/links.php
public_html/templates/[template_name]/html/layouts/joomla/pagination/list.php

Can someone help me figure out how to properly override the pagination for Joomla? If there is any other information that I can provide please let me know.

Statistics: Posted by ericuhl — Wed May 08, 2024 8:05 pm



Viewing all articles
Browse latest Browse all 1960

Trending Articles