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.

Adding a link to the top menu

ithcyithcy New
edited September 2010 in Vanilla 2.0 - 2.8
So this should be a functioning plugin:
<?php $PluginInfo['JustAMenuLink'] = array( 'Description' => 'Adds a link to the top menu.', 'Version' => '1.0', 'Author' => 'ithcy', 'AuthorEmail' => 'blah@example.com', 'AuthorUrl' => 'http://example.com' ); class JustAMenuLink implements Gdn_IPlugin { public function Base_Render_Before(&$Sender) { $Sender->Menu->AddLink('Blah', T('Blah'), '/blah/', FALSE); } public function Setup() { //nope } }

It looks to me like I'm using the API correctly, and it works great with the default vanilla theme. It does not work with other (approved) themes like Vanilla MEGA or Joie, which seem to be using a smarty template with a {custom_menu} tag. I can't tell whether the core is broken or whether the themes just need updating. Either way something ain't right here. Those themes should not be approved if they don't follow the API rules.

Can anyone tell me what I'm doing wrong?
Tagged:

Comments

  • TimTim Operations Vanilla Staff

    Vanilla Forums COO [GitHub, Twitter, About.me]

  • ToddTodd Chief Product Officer Vanilla Staff
    The smarty themes don't include support for adding items via the menu, but that's a good point. Let me look into adding support to the custom_menu tag.
  • Thanks!
  • ToddTodd Chief Product Officer Vanilla Staff
    Okay, I've modified the core so that the {custom_menu} will render stuff from the Controller->Menu if it isn't something added from the core.

    This will come out in the next release.
  • Best Todd Ever
  • ithcyithcy New
    edited September 2010
    can i pick this up in git now?

    got it from unstable, works great. Thanks again!
Sign In or Register to comment.