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.

A module dashboard for users

phreakphreak MVP
edited January 2013 in Vanilla 2.0 - 2.8

Hi all,

I recently thought about integrating a page that shows just modules. From "Who's Online" to "Top Posters" or "Most Popular". My forum is very active, but i'd like to leave keep my startpage clean of too many modules, so a page like this would be very interesting for them to check all the things at once.

Because i don't like the appeal, that every modules activated appears in the sidepanel, without asking me. Grr ;)

What do you think, and how would you start to realize it?

  • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
  • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla

Comments

  • Two ways I can think of approaching this. One is simple to implement and hacky, the other is more professional and will result in a faster page.

    1) Hacky Solution - a conditional css loader. Using some rules, such as page url regex matching, determine whether or not to load a css document which contains visibility hidden statements for the modules to remove.

    2) Better Solution - override the addmodule function via plugin. In the override, check the page url to determine if the module being added is supposed to be visible on the page. If not then bounce out, if yes, then continue on to the default addmodule method.

  • phreakphreak MVP
    edited February 2013

    *scratch".

    Mmh, i don't understand both approaches to my idea. Sorry @hbf. Maybe it helps if i clarify. I'd like to create some kind of custompage just showing modules (plugins). Like a little dashboard where users can check whats going on lately.

    I installed "CustomPages" and i can add content and styles to it but what does not work is the integration of modules like:

    <?php $this->AddModule('categories'); ?> <?php $this->AddModule('bookmarked'); ?>

    I think i have to dig deeper to those threads that deal with customized pages. A code example would be great or a small guide how to lay down a custom page within Vanilla i can adress with a straight link from the startpage. :)

    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
  • Aha found this here and i could correct the output of my modules:

    http://www.vanilla-wiki.info/vdocs/class_gdn___module.html

    But it stil acts weird:
    If i add this to my custom site <?php $this->AddModule('GuestModule'); ?> nothing happens.
    But when i add <?php $this->RenderAsset('Panel'); ?> 2 instances of the Guest Module appear.

    Whatever i do, other modules like:
    <?php $this->AddModule('NewDiscussionModule'); ?>
    <?php $this->AddModule('TagModule'); ?>
    <?php $this->AddModule('CategoriesModule'); ?>

    do not get rendered. Mmh. Any tipps for me?

    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
  • KasperKasper Vanilla Staff

    Many modules have a definedAssetTarget meaning that they can only be rendered in certain assets (like the panel) when added using the AddModule function. What I'm doing in my own themes, is add modules like this:

    Gdn_Theme::Module(NewDiscussionModule)
    

    Kasper Kronborg Isager (kasperisager) | Freelance Developer @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me on GitHub

  • Modification to the layout to suit the user. Very important but that's just me. @phreak

  • @kasperisager: Sorry, that i'm acting that dumb but how do you implement it.

    Calling it these ways doesn't work:
    <?php Gdn_Theme::Module('NewDiscussionModule'); ?> or <?php echo Gdn_Theme::Module(NewDiscussionModule); ?>

    @Srggamer: Sorry, i don't get what you are saying? Yes i want to modify to suit the layout to the user... Very important yes... ???

    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
  • @phreak said:
    Srggamer: Sorry, i don't get what you are saying? Yes i want to modify to suit the layout to the user... Very important yes... ???

    For example 1 person may want to see this the other user may not.

  • KasperKasper Vanilla Staff

    @phreak: Don't worry, there's nothing dumb about your question! I'm not sure how the Gdn_Theme class will act in plugins but it works perfectly fine in themes when echoed:

    echo Gdn_Theme::Module(ModuleName);
    

    Alternatively, you could write custom modules and use these instead of the default modules. I personally find it rather nice being able to control the output of modules and therefore often build my own ones when writing themes.

    As a sidenote, application sections are a really awesome feature in Vanilla 2.1, especially when it comes to limiting modules to certain parts of Vanilla:

    if (InSection(array('Discussion', 'DiscussionList'))):
       Gdn::Controller()->AddModule('ModuleName', 'Asset');
    endif;
    

    Kasper Kronborg Isager (kasperisager) | Freelance Developer @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me on GitHub

Sign In or Register to comment.