News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Adding Top menu Tabs

Started by BizBink, January 28, 2011, 01:03:31 PM

Previous topic - Next topic

BizBink

well i know theres a doc for that and i have read it over and over folowed it and came to a conclusion that the script im lookin g for in the defualt them Index.template.php is not on there and look like something different like this

// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;

echo '
<div id="main_menu">
<ul class="dropmenu" id="menu_nav">';

foreach ($context['menu_buttons'] as $act => $button)
{
echo '
<li id="button_', $act, '">
<a class="', $button['active_button'] ? 'active ' : '', 'firstlevel" href="', $button['href'], '"', isset($button['target']) ? ' target="' . $button['target'] . '"' : '', '>
<span class="', isset($button['is_last']) ? 'last ' : '', 'firstlevel">', $button['title'], '</span>
</a>';
if (!empty($button['sub_buttons']))
{
echo '
<ul>';

foreach ($button['sub_buttons'] as $childbutton)
{
echo '
<li>
<a href="', $childbutton['href'], '"', isset($childbutton['target']) ? ' target="' . $childbutton['target'] . '"' : '', '>
<span', isset($childbutton['is_last']) ? ' class="last"' : '', '>', $childbutton['title'], !empty($childbutton['sub_buttons']) ? '...' : '', '</span>
</a>';
// 3rd level menus :)
if (!empty($childbutton['sub_buttons']))
{
echo '
<ul>';

foreach ($childbutton['sub_buttons'] as $grandchildbutton)
echo '
<li>
<a href="', $grandchildbutton['href'], '"', isset($grandchildbutton['target']) ? ' target="' . $grandchildbutton['target'] . '"' : '', '>
<span', isset($grandchildbutton['is_last']) ? ' class="last"' : '', '>', $grandchildbutton['title'], '</span>
</a>
</li>';

echo '
</ul>';
}

echo '
</li>';
}
echo '
</ul>';
}
echo '
</li>';
}

echo '
</ul>
</div>';
}



adn theres more after that but i gave enough to get the picture... where do i type in to add another menue tab

Illori

for smf 2.0 to modify the menu you need to look in subs.php not index.template.php.

Kays

Hi, it is done differently in SMF 2.0. This should answer any questions on how it's done.

Adding tabs to SMF 2.0

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

BizBink

ok so i did that all and followed it exactly but now it shows the tab but theres no name for the tab :S

idk if its something eles or if its becasue theres no language for it

Matthew K.

If you want to, attach your Subs.php and Modifications.english.php and then explain what you want to the tab to say, and what you want it's attributes to do and I'll do it for you.

BizBink

where is the Modifications.english.php loacated at

and i just want it to show the name to the tab thats it like it just shows a blank box.... look at it here forum.bizbink.com

BizBink

ummm i dont know where the Modifications.english.php is at but i can attach the subs first for now

i just want it to say the tabs thing and nothing special its just that theres nothing there but a black box

Illori

Themes/default/languages/Modifications.english.php

BizBink

ok here you go and if you want to see what im talking baout here when i say theres nothing there but a blank box look here forum.bizbink.com

Matthew K.


BizBink

Product

but also in the future i want to be able to add sub menus

Matthew K.

Here is your Modifications.english.php.

Also - Out of curiosity, what menu mod do you have installed?

BizBink

something called custom top menu

BizBink

i added it and it still isnt there... still a blank box with no text

Matthew K.

Yeah - That's it...interesting. Did you clear your forums cache?

BizBink

i just did it twice now... any other ideas... does  it im using a another theme thats not defualt

Matthew K.

I don't see how that couldn't be working, I just double checked the code I wrote - And it should be working. Are you using UTF-8? Theme won't affect it.

BizBink


Matthew K.


BizBink

i would have no idea if i am using that or not... this is all new to me so now im thinking is my coding wrong

can you take a look at it... i uploaded it a while ago called subs.php

Advertisement: