TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,027
  • Total Topics: 21,334
  • Online today: 519
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 359
  • Total: 359

Front Page(Home) & Forum Menu tabs

Started by Rafferty, October 06, 2007, 07:01:24 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Rafferty

Small problem. After install, the forum seems to work fine. After entering via the home page, it operates correctly with the home tab in the menu selected.

When i choose forum however, the forum page loads but the home tab stays selected on the menu block. All other tabs work correctly until i come back to the forum, then the home tab shows selected again. At no time does the forum tab show as selected.

I'm using smf 1.1.4 with default theme.

G6Cad

This is a know bug that will be fixed some times when time allows.
The reason is that the home still have the action for the forum, but the home is now the frontpage of tp.

If you want to fix it now, i think there is one or two posts in here some where that explains how to. you should find them through a search  :)

ultimante

I have searched the forums as best I can and this is the only post I can find on this topic.  Could you please provide a solution for this?  I'm having the same issue.  action,forum.html still returns "home" as the $current_action.  I haven't been able to figure out how to fix this.

ultimante

I figured out a solution.


                       // Show the [home] button.
               echo '<li><a' , $current_action=='home' && !strpos($_SERVER['PATH_INFO'], "action,forum.html") ? ' class="current"' : '' , ' href="', $scripturl, '"><span>' , $txt[103] , '</span></a></li>';

                       // Show the [forum] button.
               echo '<li><a' , strpos($_SERVER['PATH_INFO'], "action,forum.html") ? ' class="current"' : '' , ' href="index.php/action,forum.html"><span>' , 'Forum' , '</span></a></li>';

ultimante

Actually, this solution only works for the index page of the forum.  Once you go into any post, it doesn't work anymore.

The best guess I have is to do it backwards.  If path info is the home page, then set the home tab, otherwise set the forum tab.

IchBin

Why not just set current_action==home. Then put forum in the current_action array? Thats the way all the other themes work. You seem to be going to the LONG way about it. lol

ultimante

#6
I'm noob when it comes to SMF Themes in the sense that I have no familiarity with how they work.  I'm basically 'hacking' a solution here in an existing theme (Outline) because there hasn't been one posted to this thread. ;)

Can you please provide a code example of how "forum" gets put into the current_action array or point me to a theme that handles this correctly so I can look at how it's done?

ultimante

Ha, I just found it when I clicked on the link in your sig (Read the TP Docs or Die).  Thanks!

ultimante

Meh, still the same problem once I actually navigate anywhere in the forum, the tab goes back to Home instead of Forum.

ultimante

Solution was to follow the instructions in the docs for adding a button, and then doing this, as well:


  // Show the [home] button.
echo '<li><a' , $current_action=='home' && !$_SERVER['PATH_INFO'] ? ' class="current"' : '' , ' href="', $scripturl, '"><span>' , $txt[103] , '</span></a></li>';

  // Show the [forum] button.
echo '<li><a' , $current_action == 'forum' || ($current_action=='home' && $_SERVER['PATH_INFO']) ? ' class="current"' : '' , ' href="', $scripturl, '?action=forum"><span>' , 'Forum', '</span></a></li>';

This website is proudly hosted on Crocweb Cloud Website Hosting.