News:

Wondering if this will always be free?  See why free is better.

Main Menu

Adding Tabs

Started by monitorr, February 24, 2010, 05:05:48 AM

Previous topic - Next topic

monitorr

Is it possible to add a user defined tab to the list that starts

[Home] [Help] [Search] [Admin] [Profile]

I want to put another tab to link back to my site?

Thanks

Chas Large

I certainly is, please see this tutorial: http://docs.simplemachines.org/index.php?topic=564.0

If this answers your question, please mark this topic as Solved, thanks.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

monitorr

Hi

I just wanted a link and identical button back to my site.

Just tried this tutorial this and I get a funny looking return button (half the size of the other buttons)and when clicked it just adds the url onto the end of the already existing url that is in the bar.

The code is below have I made mistakes?

     // Back to website Button.
     if ($context['current_action'] == 'return')      
     $current_action = 'return';
    
     // Show the [return] button.   
     echo ($current_action=='return' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '            
    
     <td valign="top" class="maintab_' , $current_action == 'return' ? 'active_back' : 'back' , '">               
     <a href="www.mydomain.com">Return</a>            
     </td>' , $current_action == 'return' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
     
echo '</ul></div></div>';     


Chas Large

I'm assuming you're using the default theme. If you post your index.template.php file here as an attachment, I'll have a look at it for you.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

monitorr

sure, only problem is I am not sure how to attach the file. Can you tell me what I need to do as I cant seem to find the attachment button.

Thanks

Chas Large

When you reply, there is a link with a button to the left, called Additional Options below the text entry box. Click that and then the browse button to find and attach your file.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

monitorr

Hi again

Thanks. I have now attached the file.

Chas Large

OK, this file does not look like its from the default theme and therefore makes it very difficult for me to edit for you.

I have however edited a default theme index.template.php file and tested it, so that now gives a return button.. See attached.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Kays

If you look at the code for the other buttons you'll notice that it's different from the default Core theme tabs.

What you need to use is something like this:

   echo   '<li><a href="http://MySite.com"><span>Return</span></a></li>';

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

monitorr

Ok that is great thanks but it has gone back to the default theme again. The theme I would like to use is the preset Babylon Theme that is available within the Admin themes and layout section.

I noticed that Kays has put the code:

   echo   '<li><a href="http://mysite.com [nofollow]"><span>Return</span></a></li>';

Where would that go bearing in mind that I want to use a theme other then the Default theme?

Kays

The file Chas Large posted is for the Core or default theme. Which is why you are seeing the tabs.

The code I posted can be added to the file you attached previously. Add it before the home button. (   // Show the [home] and [help] buttons.)

If you wish to use the Babylon theme now it might get a bit trickier if you want to use the image buttons. Since you need one of those first.

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

Advertisement: