News:

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

Main Menu

[1.1] How to add tabs to Core (NDT)?

Started by JayBachatero, December 31, 2005, 04:21:57 PM

Previous topic - Next topic

ladyshanae

Redeye -

I'm going to guess your code looks something like this:

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

You want to replace this:

<a href="', $scripturl, '?action=gallery">Chat</a>

With this:

<a href="insert_gallery_url_here">Gallery</a>

Obviously where 'insert_gallery_url_here' is the link to your gallery.

Hope that helps!

JayBachatero

Actually take a look at Photo Gallery....  It shows you how to do it so that it will work with the action=gallery.  Take a look at my website.  I have it like that too.  http://www.kevmundial.com/board/index.php?action=gallery
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Dazzler

#82
Just a quick and really simple one guys...

I am running the default theme in RC2, i have my button for my gallery working fine, but i have lost the "light blue" colour when pressed--- i am very new to this i am sure this is a two second fix.

Link to site www.minidirectory.co.uk/forum.

Thanks for the great support so far guys.

SMF 1.1.3 + TP .983 + Copperminie

JayBachatero

Use this.

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

if ($context['current_action'] == 'coppermine')
$current_action = 'search';
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Dazzler

Hi there... i tried above (if that was for me) and it didnt work..

this is my code.... in index.template

Quote// Show the [gallery] button.

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


my site is www.minidirectory.co.uk/forum

SMF 1.1.3 + TP .983 + Copperminie

JayBachatero

Small mistake.
Code (find) Select

if ($context['current_action'] == 'coppermine')
$current_action = 'search';

Code (replace) Select

if ($context['current_action'] == 'coppermine')
$current_action = 'coppermine';


Also paste that Above where the other statments for current action are.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Dazzler

Hi jay again.... if i use your posted code even with the amendments i loose the button of my nav bar... with the code i posted above the button shows and works fine, it just doesnt change to "light blue" when pressed.

Any ideas? am i editing the right file index.template?


SMF 1.1.3 + TP .983 + Copperminie

Veej

After installing TP and using their given index.template.php file I hve lost the arcade and shop buttons.

Will this method make it so that they are highlighted when the user is in the shop like the admin button bg sort of enlarges like a tab when you are in the ACP?

JayBachatero

Doggy sorry for the late response must have missed this one by mistake.  Did you add the code I gave you BEFORE the button?  Under the search one?

Veej yes this method will make the tabs active.  Just follow the steps and you will be fine :)
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Dazzler

jay.. would you mind if i sent you my "Index.template" for 2 mins of your attention..

Daz

SMF 1.1.3 + TP .983 + Copperminie

JayBachatero

Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Dazzler

email sent.. you might want to delete you mail before you get hundreds of requests... thanks for your time... Daz

SMF 1.1.3 + TP .983 + Copperminie

JayBachatero

Ok here you go.  You where mis this

        if ($context['current_action'] == 'coppermine')
$current_action = 'coppermine';


Also I don't really care if people email me stuff as long as I ask for it and they are polite about it ;)
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

thetzfreak

For some reason my template.index.php doesn't have this line =\

if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))
Maybe it's in another file? My template is SMFone. Thanks for the help in advance.

Thanks.

JayBachatero

This method is only for Core, Amber and PnPn.  Those themes are using this tab method.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

tarkhorani

I want to add an menu option named as "Banner Exchange"
I want to show the forum header and footer and it show a page named as banner.htm between header and footer , what can I do?
Get a Free SMForum on http://www.myboards.com (Ver 1.1.1)



JayBachatero

To add a menu item take a look at first post.  To add something to header and footer add include('banner.htm');  Add it to the template_main_above and teplate_main_bellow functions in index.template.php
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

tarkhorani

thanks, I understand how to add option, but I want when click on it show this:

page = {
Header of forum
banner.htm
footer of forum
}
Get a Free SMForum on http://www.myboards.com (Ver 1.1.1)



bloc

You physically get that displayed you mean?

JayBachatero

You can use this

if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'blah')
{
   include(
'blah.txt');
}
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Advertisement: