Advertisement

trying to add joomla pagination to module - need help Topic is solved

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

Moderators: ooffick, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
yana22
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Fri Feb 07, 2025 6:00 am

trying to add joomla pagination to module - need help

Post by yana22 » Sun Feb 16, 2025 11:06 am

hi
i have a component (not joomla articles) ,
it use the joomla default pagination on items that display on the site from menu item .
but the module of this component not has a pagination .
i want to add pagination in the module .

the component use this code to show and use the pagination in default.php :

Code: Select all

<?php echo $this->pagination->getListFooter(); ?>
i added the same code in the module default.php but not works .
i get a blank page with this error :

Code: Select all

0
Using $this when not in object context
what changes can do on this code to make it works on the module ?

Advertisement
MarkRS
Joomla! Explorer
Joomla! Explorer
Posts: 385
Joined: Thu Oct 29, 2009 8:28 am
Location: UK

Re: trying to add joomla pagination to module - need help

Post by MarkRS » Tue Feb 18, 2025 3:08 pm

There is no $this in your situation because the module load is quite different to a view load.

Look at what a normal view does to get that pagination object. It simply calls

Code: Select all

$this-get('pagination')
which, to SharkyKZ's upset, calls the getPagination method of the relevant model. So that's what you need to do to get this footer. If it needs to be a specific instance of that model then you might have a bit more work to do finding that.
It's a community, the more we all contribute, the better it will be.

yana22
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Fri Feb 07, 2025 6:00 am

Re: trying to add joomla pagination to module - need help

Post by yana22 » Thu Feb 20, 2025 3:35 pm

MarkRS wrote: Tue Feb 18, 2025 3:08 pm There is no $this in your situation because the module load is quite different to a view load.

Look at what a normal view does to get that pagination object. It simply calls

Code: Select all

$this-get('pagination')
which, to SharkyKZ's upset, calls the getPagination method of the relevant model. So that's what you need to do to get this footer. If it needs to be a specific instance of that model then you might have a bit more work to do finding that.
yes .
very thanks .

Advertisement

Post Reply

Return to “Joomla! 5.x Coding”