Override BadgesModule

This discussion is related to the Yet Another Gamification Application addon.

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?

My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations

  • Vanilla APP » Learn more «
  • iOS & Android App for Vanilla - White label app for your forum

Comments

  • hgtonighthgtonight ∞ · New Moderator

    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.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

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

    My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations

    • Vanilla APP » Learn more «
    • iOS & Android App for Vanilla - White label app for your forum
    hgtonight
  • 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);
        }
    }
    

    My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations

    • Vanilla APP » Learn more «
    • iOS & Android App for Vanilla - White label app for your forum
    peregrinehgtonight
Sign In or Register to comment.