SMF Support > SMF 2.0.x Support
Help: Adding a menu button for SMF2.0 Beta3.1
(1/1)
wjhdiz:
The template_nemu() function changed in SMF2.0. I used to have a front page with SSI calls and some other stuff and I call it home_root and I made change in index.template.php template_nenu(), However, the new function changed the way it used to and I am having a problem to add the new button. I use the Classic theme. The new function mentioned here is:
--- Code: ---// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;
// We aren't showing all the buttons in this theme.
$hide_buttons = array('pm', 'mlist');
foreach ($context['menu_buttons'] as $act => $button)
if (in_array($act, $hide_buttons))
continue;
else
echo '
<a href="', $button['href'], '">', $settings['use_image_buttons'] ? '<img src="' . $settings['lang_images_url'] . '/' . $act . '.gif" alt="' . $button['title'] . '" border="0" />' : $button['title'], '</a>', !empty($button['is_last']) ? '' : $context['menu_separator'];
}
--- End code ---
Any help is greatly appreciated.
Thanks.
Jimmy
Nathaniel:
Have a look at the menu function at the end of the 'sources/subs.php' file, you can add buttons there. In SMF 2 Beta you don't need to add extra buttons to the template files themselves, you can add them to that source file.
Also, I am currently making a mod called the Custom Menu Mod, which will allow you to customize your menu from the admin section, but anyways... :)
Rumbaar:
Were you able to add your required buttons via the suggested Subs.php file wjhdiz?
wjhdiz:
I made it and this problem is solved. Thanks.
Navigation
[0] Message Index
Go to full version