News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Need Help Adding Menu tab

Started by mag00, May 13, 2007, 11:21:56 AM

Previous topic - Next topic

mag00

Yes, sad but true. I read the faq's searched the forum and cannot find the way to do it. I can add the tab, but where do I add the tab functionality? Where do I add the url for when the tab is clicked to go to?

I am running 1.1.2 and purple rain.

I also want to do this on a friends forum.  1.1.1 aero

Anybody done this and can help?

Dragooon

lol you are like me It was the same
If you know how to add a code in Index.template.php file ten thats it that is the link

mag00

I can add code, I have no problem finding the area, just where do I add the hxxp:linkurl.com/ [nonactive]? The page I want to go to from the menu. to=>My HOMEPAGE of MY Website, not forum home. I find no mention of that. I also want to add a few other menu items.

Where oh where do I find that section?

Dragooon

That is what i want to do to.

mag00

Quote// Show the [chat] button.
   echo ($current_action=='chat' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'chat' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=chat">Chat</a>
            </td>' , $current_action == 'chat' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


Would I put my domain name somewhere in here for linking? of cours I wouldn't use "chat", but is this the right area?

mag00

#5
OK here is how I did it.


I copy pasted the whole section then just modified accordingly.

Works like I wanted, home takes me to my domain home page, then the second tab is forum, if you leave the txt103 it will still say home on the second tab.

hope this helps

metallica48423

it seems you were able to get it

This is the link i mentioned i wrote up which i believe i have covered what needs changed (this link will not work forever eventually it'll be deleted)
http://smfsucks.com/testcenter/index.php?topic=7.msg10#msg10

Also, you can remove all the comma's and spaces between > and FORUM and also on the other side before the <.  They're unnecessary as the FORUM is to be parsed as HTML/plaintext and not PHP
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

mag00

OK, I will clean up the code then. 

Yes, I eventually through trial and error either totally break things or fix em. Sometimes I just re-install.

Thing is I will have to now do this to all the themes, for it to work right? 

Seems a pain, but I can live with that.

So just in case you check this again, can I substitute the text  in the "forum" with an img tag? You said it was parsed html, then if I size the pics right, my nav could be totally custom right?

Might just give it a shot. I really don't want to learn how to code. This little to do was more than plenty for me. If I can just substitute things, that is best for me. ;)

metallica48423

QuoteThing is I will have to now do this to all the themes, for it to work right? 

Indeed.  2.0 will, from what i hear, handle the navigation bar differently, so hopefully it might be a little easier to do in the future.

QuoteSo just in case you check this again, can I substitute the text  in the "forum" with an img tag? You said it was parsed html, then if I size the pics right, my nav could be totally custom right?

Yes
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

Matthew Schenker

I am trying to do a similar thing here.  I want to add a new tab to the main menu that will link members to a Coppermine gallery located at a different URL.  I've read the SMF instructions on how to do this like 50 times but I still can't figure out how to do it.

Would it be possible for someone to post a sample of a block of code that shows how to create a new tab that links to an external URL?

Thanks!

greyknight17

@Matthew, try this. That should be simple enough to follow through :)

Sample code provided in there...

Matthew Schenker

I just got an answer on how to do this from a member named Snowsh in another discussion.

Here's what he said to do. It worked!

QuoteFile: index_template.php

find:
// The end of tab section.
echo '

Add this code just above prv text. (repeat as required)

// add static link
echo '
<td valign="top" class="maintab_back"><a href="http://www.domain.com/etc">title</a></td>';

Another member, metallica48423, in a separate discussion, helped me figure out how to open the link in a new window:

Quoteafter href="http://www.domain.com/etc", add target="_blank"
ie:
<a href="http://www.domain.com/etc" target="_blank">title</a>

Now I've got the whole thing straight.

Thanks!

Advertisement: