Author Topic: Adding navigation tabs to default index.template.php  (Read 6996 times)


  • Jr. Member
  • **
  • Posts: 139
    • Advise or Answers
Adding navigation tabs to default index.template.php
« on: July 21, 2007, 01:32:13 PM »
I am learning PHP by trial and error and I seem to be making more errors right now. Here's my latest problem....

 I am adding an entry point for members to access the articles section of my site. I am using the "custom actions" mod to do so. My problem at this point is adding a navigation tab for that page to the row of default tabs across the top of the page.

I am using the default theme of SMF 1.1.3 & TP v0.9.8

This what I have do so far and I can not get the new tab to show. I would really appreciate someone pointing out what I am doing wrong.

To the default index.template.php I added:
Code: [Select]
Code: [Select]
if (in_array($context['current_action'], array('WritersCafe','staff','links','contact','tags','usercp','gallery','search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'forum', 'tpadmin')))
$current_action = $context['current_action'];
Then added:
Code: [Select]
// the [Writer's Cafe'] button.
echo ($current_action == 'Writerscafe' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'WritersCafe' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=WritersCafe">' , $txt['WritersCafe'] , '</a>
</td>' , $current_action == 'WritersCafe' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
Code: [Select]
// Show the start of the tab section.
echo '
<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">
<td class="maintab_' , $first , '">&nbsp;</td>';

After posting this I realized I was posting in the wrong board. I am sorry about that.
« Last Edit: July 21, 2007, 01:34:38 PM by »
Social Networking