SimplePortal
Customization => Themes and Graphics => Custom Theme Tutorials => Topic started by: gamerxgirl on January 26, 2009, 06:28:50 PM
-
This tutorial is for the Passion (http://custom.simplemachines.org/themes/index.php?lemma=439) theme by Crip (http://custom.simplemachines.org/themes/index.php?action=profile;u=28329).
Adding Custom Tabs
Open index.template.php located in your Themes/passion folder (if you already installed theme on your forum).
Find:
if ($context['current_action'] == 'search2')
$current_action = 'search';
After on the next line add:
if ($context['current_action'] == 'LINKNAME')
$current_action = 'LINKNAME';
Replace LINK NAME with the name of your link.
Then Find:
echo '<ul id="menubox">
<li><a' , $current_action=='home' ? ' class="chosen"' : '' , ' href="', $scripturl, '">' , $txt[103] , '</a></li>';
After it add:
echo '<li><a' , $current_action=='LINK ACTION' ? ' class="current"' : '' , ' href="', $scripturl, '?action=forum"><span>' , 'LINK NAME' , '</span></a></li>';
Replace LINK NAME with the name of your link and LINK ACTION with the name of your action, for example 'forum'.
External URL
Or if you're going to be using a non-smf/external url you would use the following:
echo '<li><a href="URL"><span>URL NAME</span></a></li>';
Replace URL with the url you'd like to link to, and URL NAME to what you'd like to name your url.
Tab Link in a New Window
If you'd like the link to open in a new window you would add:
target="new"
or
target="_blank"
like so:
echo '<li><a href="URL" target="new"><span>URL NAME</span></a></li>';
-
Thanks gamerxgirl! Maybe you can make it SimplePortal specific, to make it more easier.
-
Thanks for making this tutorial gamerxgirl. :)
Below are some more specific instructions for this theme, if anyone needs more specific instructions.
Search for
echo '<li><a' , $current_action=='help' ? ' class="chosen"' : '' , ' href="', $scripturl, '?action=help">' , $txt[119] , '</a></li>';
Replace with
if(!empty($context['portalactive']))
echo '<li><a' , $current_action=='forum' ? ' class="chosen"' : '' , ' href="', $scripturl, '?action=forum">' , $txt['sp-forum'] , '</a></li>';
echo '<li><a' , $current_action=='help' ? ' class="chosen"' : '' , ' href="', $scripturl, '?action=help">' , $txt[119] , '</a></li>';
Search for
$current_action = 'search';
Replace with
$current_action = 'search';
if ((isset($_GET['board']) || isset($_GET['topic']) || in_array($context['current_action'], array('unread', 'unreadreplies'))) && !empty($context['portalactive']))
$current_action = 'forum';
if ($context['current_action']=='spadmin')
$current_action = 'admin';
Search for
, 'login', 'help', 'pm'
Replace with
, 'login', 'help', 'pm', 'forum', 'spadmin'
Moved to the 'Custom Theme Tutorials' board.