Jpagination getListFooter not working

For Joomla! 3.x Coding related discussions, you could also use: http://groups.google.com/group/joomla-dev-general

Moderators: ooffick, General Support Moderators

Forum rules
Locked
adam.hughes
Joomla! Intern
Joomla! Intern
Posts: 94
Joined: Thu Sep 15, 2005 7:30 am

Jpagination getListFooter not working

Post by adam.hughes » Wed May 18, 2022 9:06 pm

I have a strange issue with the jPagination class that I have implemented for my component.

I generate a new JPagination class in the controller and pass it to the view.
In the view I then try to utilise the $pagination->getListFooter();
The row is display correctly in the page, but the url it uses for each link is incorrect as it lists the link as follows :
https://www.mywebsite.com/youraccount#
but the link should be something like this :
https://www.mywebsite.com/youraccount?t ... s&start=20

The strange bit is, if I use $pagination->getPagesLinks(); it works correctly (but it is display as a list of pages in an unordered list which is not styled correctly like the getListFooter).
Last edited by toivo on Wed May 18, 2022 10:22 pm, edited 1 time in total.
Reason: mod note: moved from 3.x Extensions

adam.hughes
Joomla! Intern
Joomla! Intern
Posts: 94
Joined: Thu Sep 15, 2005 7:30 am

Re: Jpagination getListFooter not working

Post by adam.hughes » Wed May 18, 2022 9:07 pm

Also when I dump out $pagination->getData(); to the webpage every single URL is correctly formed (as shown below).

Code: Select all

stdClass Object ( [all] => Joomla\CMS\Pagination\PaginationObject Object ( [text] => View All [base] => 0 [link] => /youraccount?task=stock.items [prefix] => [active] => ) [start] => Joomla\CMS\Pagination\PaginationObject Object ( [text] => Start [base] => 0 [link] => /youraccount?task=stock.items&start=0 [prefix] => [active] => ) [previous] => Joomla\CMS\Pagination\PaginationObject Object ( [text] => Prev [base] => 60 [link] => /youraccount?task=stock.items&start=60 [prefix] => [active] => ) [next] => Joomla\CMS\Pagination\PaginationObject Object ( [text] => Next [base] => 100 [link] => /youraccount?task=stock.items&start=100 [prefix] => [active] => ) [end] => Joomla\CMS\Pagination\PaginationObject Object ( [text] => End [base] => 680 [link] => /youraccount?task=stock.items&start=680 [prefix] => [active] => ) [pages] => Array ( [1] => Joomla\CMS\Pagination\PaginationObject Object ( [text] => 1 [base] => 0 [link] => /youraccount?task=stock.items&start=0 [prefix] => [active] => ) [2] => Joomla\CMS\Pagination\PaginationObject Object ( [text] => 2 [base] => 20 [link] => /youraccount?task=stock.items&start=20 [prefix] => [active] => ) [3] => Joomla\CMS\Pagination\PaginationObject Object ( [text] => 3 [base] => 40 [link] => /youraccount?task=stock.items&start=40 [prefix] => [active] => ) [4] => Joomla\CMS\Pagination\PaginationObject Object ( [text] => 4 [base] => 60 [link] => /youraccount?task=stock.items&start=60 [prefix] => [active] => ) [5] => Joomla\CMS\Pagination\PaginationObject Object ( [text] => 5 [base] => [link] => [prefix] => [active] => 1 ) [6] => Joomla\CMS\Pagination\PaginationObject Object ( [text] => 6 [base] => 100 [link] => /youraccount?task=stock.items&start=100 [prefix] => [active] => ) [7] => Joomla\CMS\Pagination\PaginationObject Object ( [text] => 7 [base] => 120 [link] => /youraccount?task=stock.items&start=120 [prefix] => [active] => ) [8] => Joomla\CMS\Pagination\PaginationObject Object ( [text] => 8 [base] => 140 [link] => /youraccount?task=stock.items&start=140 [prefix] => [active] => ) [9] => Joomla\CMS\Pagination\PaginationObject Object ( [text] => 9 [base] => 160 [link] => /youraccount?task=stock.items&start=160 [prefix] => [active] => ) [10] => Joomla\CMS\Pagination\PaginationObject Object ( [text] => 10 [base] => 180 [link] => /youraccount?task=stock.items&start=180 [prefix] => [active] => ) ) )
I just cannot find the issue with the $pagination->getlistfooter(); method.

Thank you in advance

adam.hughes
Joomla! Intern
Joomla! Intern
Posts: 94
Joined: Thu Sep 15, 2005 7:30 am

Re: Jpagination getListFooter not working

Post by adam.hughes » Wed May 18, 2022 9:23 pm

I have managed to generate a work around for my issue by using the following code :

Code: Select all

$newpagination = $pagination->getPagesLinks();
$newpagination = str_replace("<ul>","<ul class=\"pagination-list\">",$newpagination);
So the $newpagination string is a working pagination list styled correctly, but ideally I would use $pagination->getListFooter(); as this is styled even nicer, plus has the arrows for the start end etc.

So if anyone could point me in teh right direction I would like to fix it, if not I will just work with my workaround.

Cheers


Locked

Return to “Joomla! 3.x Coding”