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.
Options

Display Module on non dashboard or settings pages

edited November 2010 in Vanilla 2.0 - 2.8
What is the best controller method to make code run on all pages but dashboard and settings pages.

ive used Discussions_render_before and Base_render_before
but i cant get it to show on discussion lists or category lists.

Comments

  • Options
    LincLinc Detroit Admin
    edited November 2010
    It's DiscussionsController_Render_Before and Base_Render_Before. You have the last 2 parts of the name reversed. The pattern is: {ClassName}_{Method}_{Hook}
  • Options
    Corrected. Any idea on the method name to run code on discussion list pages
  • Options
    LincLinc Detroit Admin
    edited November 2010
    Well, you could use an existing hook in that part of the code, you could request a new hook if there isn't one where you need it, or you could just use DiscussionsController_Render_Before to glom onto every use of Discussions (if you're really sure that's what you need, because needlessly using Render_Before for everything makes Tim throw Coke cans at developers).
  • Options
    id rather not use the discussions controller render before as that makes it controller specific and im using categories and discussions on the forum. Im currently using the code below but on pages which are not the root dashboard page it shows still.
    public function Base_Render_Before(&$Sender) { if (!in_array('Garden.Settings.Manage', $Sender->RequiredAdminPermissions)) //code }

    Regarding not using render before is there a better way to add a module to the panel?
  • Options
    LincLinc Detroit Admin
    edited November 2010
    I'm not really understanding what you're asking.

    You can use CategoriesController_Render_Before if you need it on those pages too.
Sign In or Register to comment.