Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Change pager type to MorePager
Hi all,
I am in the process of creating a custom vanilla powered forum. I have a class.mythemehooks.php in the root of my theme folder.
The other functions in the class work fine but i'm having difficulty when trying to use the MorePager instead of the default numbered one.
I am using the following code in my class.mythemehooks.php:
I then have this to output the pager in my views/discussions/index.php file:
By viewing the source code I can see that the following files are loaded:
How can I get it so that the default numbered pager is changed to the MorePager?
Thank you for your help
I am in the process of creating a custom vanilla powered forum. I have a class.mythemehooks.php in the root of my theme folder.
The other functions in the class work fine but i'm having difficulty when trying to use the MorePager instead of the default numbered one.
I am using the following code in my class.mythemehooks.php:
// Change all pagers to be "more" pagers instead of standard numbered pagers
public function DiscussionsController_BeforeBuildPager_Handler($Sender) {
$Sender->EventArguments['PagerType'] = 'MorePager';
}
public function DiscussionController_BeforeBuildPager_Handler($Sender) {
$Sender->EventArguments['PagerType'] = 'MorePager';
}
public function DiscussionController_BeforeDiscussion_Handler($Sender) {
echo $Sender->Pager->ToString('less');
}
public function DiscussionController_AfterBuildPager_Handler($Sender) {
$Sender->Pager->LessCode = 'Older Comments';
$Sender->Pager->MoreCode = 'More Comments';
}
public function DiscussionsController_AfterBuildPager_Handler($Sender) {
$Sender->Pager->MoreCode = 'More Discussions';
}
I then have this to output the pager in my views/discussions/index.php file:
echo $this->Pager->ToString('more');
By viewing the source code I can see that the following files are loaded:
/js/library/jquery.gardenmorepager.js?v=2.0.17.10
/applications/vanilla/js/discussions.js?v=2.0.17.10
How can I get it so that the default numbered pager is changed to the MorePager?
Thank you for your help
0
Answers