Rename menu discussions link
I'm trying to rename the 'Discussions' link to Recent Discussions (vanilla 2.1):
In the Base_Render_Before hook I've got:
public function Base_Render_Before($Sender, $Args) {
$Sender->Menu->Items['Discussions'][0]['Text'] = T('Recent Discussions');
}
The above code isn't working. Where should I do this?
0
Comments
IIRC, it's not possible to do it that way. Here are other ways you can change the link:
/conf/locale.phpfile and add these lines:<?php if(!defined('APPLICATION')) exit(); $Definition['Discussions'] = 'Recent Discussions';This may affect other strings that use the same localization.
Remove
{discussions_link}from your theme'sdefault.master.tpland add in a custom link.You can use JavaScript or CSS to change the text.
Add Pages to Vanilla with the Basic Pages app
Seems to me this is something that should be done using a hook. As other plugins could interact with the menu as well.
I don't know which hook would be best, but
class.sidemenumodule.phphas a RemoveLink() function which might be useful for you in addition with the AddLink function.The "Discussions" link has the "Standard" attribute set to TRUE, so using a hook with the RemoveLink method will empty out the array
$Sender->Menu->Items['Discussions'], but the link will still be in the main menu because the link gets outputted by the{discussions_link}in thedefault.master.tplfile, which you can safely remove or comment out.Add Pages to Vanilla with the Basic Pages app