HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

New Add-on: Widgets

vrijvlindervrijvlinder Papillon-Sauvage MVP

Hi, since I discovered how to make modules for Vanilla, I have been making them none stop. This plugin gives you a way to put all your modules in one place as you go instead of making single plugins for each module.

There are no settings since all you need to do is add the code you want in the module you create then add that to default.

You can comment out the modules you don't want to use at that moment.

What makes this better than the messages maker that also puts content in the panel? That you can sort them using a configuration.

At the very least use this plugin as a guide to make your own suite of modules/widgets.

Comments

  • Options

    I just installed this but I have no idea how to configure it to work. You talked about putting code in - but put it in where? Confused!!!

    Sheena

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    Are you seeing any widgets ? There should be sample widgets showing in the panel . To change them , edit the code for the corresponding widgets or make new modules for them, in the module folder.

    The modules are the widgets. So go inside the module folder , open up one of the modules and see how the code is inserted.

    Make a new module or edit the existing ones.

    for example in the class.youtubemodule.php

    <?php if (!defined('APPLICATION')) exit();
    
    class YouTubeModule extends Gdn_Module {
    
    
    
    
       public function AssetTarget() {
          return 'Panel';
       }
    
       public function ToString() {  
    
         echo '<div class="Box" id="YouTube"><h4>YouTube</h4>
    
    <script src="//www.gmodules.com/ig/ifr?url=http://hosting.gmodules.com/ig/gadgets/file/100080069921643878012/youtube.xml&amp;synd=open&amp;w=250&amp;h=200&amp;title=&amp;bg-color=black&amp;border=&amp;output=js"></script>
    
    
    
          </div>';  
    
         //Add your Html between the divs above
    
    
    
    
       }
    }
    

    Notice how the code is inserted.

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    Then you need to add your module to the default.php so it can be called

    $YouTubeModule = new YouTubeModule($Sender);
       $Sender->AddModule($YouTubeModule);
    
  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    To create a new module

    make a file name it whatever but add the word module class.examplemodule.php

    copy the content from the existing module and then just replace the code or html you want to add.

    Then add it to the list in the default.php for the pages you want it to show in.

    $ExampleModule = new ExampleModule($Sender);
       $Sender->AddModule($ExampleModule);
    
Sign In or Register to comment.