News:

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

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

JayBachatero

http://www.simplemachines.org/community/index.php?topic=63203.msg437231#msg437231

This step "1. In index.template.php".  Use the first method and remove the other $current_action you added.
Follow me on Twitter

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

Penelope


randomdood

it's not working for me :(
i got this
// Show the [shop] button...
      echo ($current_action == 'shop' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'shop' ? 'active_back' : 'back' , '">
               <<a href="', $scripturl, '?action=shop">shop</a>
            </td>' , $current_action == 'shop' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : ''

yet no shop tab is appearing

JayBachatero

You seem to be missing a (;) at the end of the last line.
Follow me on Twitter

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

randomdood


JayBachatero

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

Remove the extra <
Follow me on Twitter

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

randomdood

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

JayBachatero

The tab is not showing at all or what?
Follow me on Twitter

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

randomdood

well from the start the tab button (shop) has been showing but not in any other themes.

JayBachatero

You need to edit the rest of your themes to add the buttons/tabs.
Follow me on Twitter

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

Jen Smith

Great tutorial, added a few tabs with no problems... except one, and I'm not sure what all I'm doing wrong.

Using TinyPortal, and want to add a tab for the download page.  (The action is tpmod;dl=0).

So, I modified this line:
if (in_array($context['current_action'], array('Bookmarks','chat','tpmod;dl=0','search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'pm', 'forum', 'tpadmin')))

And added this further down:
// Add a download tab (tpmod;dl=0)
echo ($current_action == 'tpmod;dl=0' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'tpmod;dl=0' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=tpmod;dl=0">Files</a>
</td>' , $current_action == 'tpmod;dl=0' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


It does work.  I see the tab, and it sends me to the right page.  What it's not doing is showing as the "active tab" if you get me.  The others that I've added work properly (bookmarks, chat and so on.)

I'm sure it's something stupid, but I'm missing it -- anyone have an idea?

Jen Smith

Gah, I found my problem.  Apparently TP does a lil switcheroo on the actions somewhere.

Slight modification got it working:
// Add a download tab tpmod;dl=0
echo ($current_action=='dlmanager' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'dlmanager' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=tpmod;dl">Files</a>
</td>' , $current_action == 'dlmanager' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


I had to change most of them to "dlmanager", except for the one that's actually being sent when you hit the tab.

randomdood


randomdood


JayBachatero

Add the image tag right before the <a href...
Follow me on Twitter

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

randomdood

so that just the <img src="url">???

JayBachatero

Follow me on Twitter

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

randomdood


JayBachatero

Let me see the code you have now.
Follow me on Twitter

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

randomdood

//Begin SMFShop 2.0 (Build 8) MOD code
//loadLanguage("shop");
echo ($current_action == 'shop' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'shop' ? 'active_back' : 'back' , '">
<img src="http://switchfoot.cknetworx.com/smf/themes/autumndark1-1-RC2/images/english/shop.gif><a href="', $scripturl, '?action=shop">Shop</a>
</td>' , $current_action == 'shop' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
//END SMFShop MOD code


now the text that said shop isn't even linked to anything

Advertisement: