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
ithcy
New
So this should be a functioning plugin:
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?
<?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:
0
Comments
Vanilla Forums COO [GitHub, Twitter, About.me]
This will come out in the next release.
got it from unstable, works great. Thanks again!