Override BadgesModule

To conform with my legacy award system I would like to group badges shown in the BadgesModule by rule.

Is there a non-invasive way I can override the badges module (or just the view) that comes with Yaga from a plugin?

Comments

  • You should be able to place a copy of /applications/yaga/views/modules/badges.php into your theme at /themes/YourTheme/views/modules/badges.php and modify it as you wish.

    If you just want to sort the data, that is coming in Yaga 1.1.

  • Awesome, totally forgot about theme overrides! That'll do too.

  • Just fyi, I found another way to switch out the modules, reusing the already fetched data:

    public function ProfileController_Render_Before($Sender) {
        if (C('Yaga.Badges.Enabled')) {
            $Data = $Sender->Assets['Panel']['BadgesModule']->Data;
            unset($Sender->Assets['Panel']['BadgesModule']);
            $CustomBadgesModule = new CustomBadgesModule($Sender, $Data);
            $Sender->AddModule($CustomBadgesModule);
        }
    }
    
Sign In or Register to comment.