Jump to content

How to add custom tab to leaderboard?


Recommended Posts

Hi everyone,

I'm making an IPS Application to support my game and I found myself stuck for past few hours.
I've been trying to add another tab to leaderboard, just like this:


Now, I've managed to achieve above by creating a theme hook and adding another <li> element at the start of tabs.
Element code looks like this:

<li role="presentation">
<a href="index.php?app=core&module=discover&controller=popular&tab=gamescore" role="tab" id="elTabgamescore" class="ipsType_center ipsTabs_item">
<i class="fa fa-gamepad"></i>

Next thing I've been trying to do, was to make the controller display custom page on which I would display top users by gamescore.
I've added another hook for \IPS\core\modules\front\discover\popular class and assumed that after I add protected function amescore() and display some data in it, it should work.
Also tested with &do=gamescore instead of &tab=gamescore.

protected function gamescore()
    \IPS\Output::i()->error( 'module_no_permission', '2C343/1', 403, '' );   

I filled it with some sample error just to check if it works, but it didn't.
The tab seems to load the ipsTabs_panel element and javascript seems to be switching between those tabs just fine, but the content of panel stays default, in this case it's the leaderboard.

My question is: 
How can I make that url route to correct function and fill in panel space with correct data?


Edited by Hazes
Link to comment
Share on other sites

  • 2 weeks later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...