Hi all,
I'm working on an extension that uses a "Preview" button, the same as on edit pages. Unfortunately the shortcut key for the button conflicts with the "Printable version" link in the navigation bar, effectively preventing the keyboard shortcut from working at all.
The edit page does not have this problem as the "Printable version" link does not appear, so hiding that on my extension's Special page seems like the best solution. Unfortunately I can't see how to do this - it looks like the link always shows on article or special pages.
Does anyone know if there's a way I can stop the "Printable version" link from appearing in the navigation bar on pages my extension provides?
Many thanks, Adam.
$wgHooks['BaseTemplateToolbox'][] = 'eWhateverBaseTemplateToolbox'; function efWhateverBaseTemplateToolbox ( $tpl, $toolbox ) { if( //check whether it's your extension's page ) { unset($toolbox['print']); } return true; }
$wgHooks['BaseTemplateToolbox'][] = 'eWhateverBaseTemplateToolbox'; function efWhateverBaseTemplateToolbox ( $tpl, $toolbox ) { if( //check whether it's your extension's page ) { unset($toolbox['print']); } return true; }
Brilliant, works like a charm! I just had to change "$toolbox" to "&$toolbox" in the function declaration, in case anyone else needs this in future.
Many thanks for your help!
Cheers, Adam.
mediawiki-l@lists.wikimedia.org