Customization > Custom Theme Tutorials
Passion by Crip (Outdated)
(1/1)
gamerxgirl:
This tutorial is for the Passion theme by Crip.
Adding Custom Tabs
Open index.template.php located in your Themes/passion folder (if you already installed theme on your forum).
Find:
--- Code: --- if ($context['current_action'] == 'search2')
$current_action = 'search';
--- End code ---
After on the next line add:
--- Code: --- if ($context['current_action'] == 'LINKNAME')
$current_action = 'LINKNAME';
--- End code ---
Replace LINK NAME with the name of your link.
Then Find:
--- Code: ---echo '<ul id="menubox">
<li><a' , $current_action=='home' ? ' class="chosen"' : '' , ' href="', $scripturl, '">' , $txt[103] , '</a></li>';
--- End code ---
After it add:
--- Code: --- echo '<li><a' , $current_action=='LINK ACTION' ? ' class="current"' : '' , ' href="', $scripturl, '?action=forum"><span>' , 'LINK NAME' , '</span></a></li>';
--- End code ---
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:
--- Code: --- echo '<li><a href="URL"><span>URL NAME</span></a></li>';
--- End code ---
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:
--- Code: ---target="new"
--- End code ---
or
--- Code: ---target="_blank"
--- End code ---
like so:
--- Code: --- echo '<li><a href="URL" target="new"><span>URL NAME</span></a></li>';
--- End code ---
[SiNaN]:
Thanks gamerxgirl! Maybe you can make it SimplePortal specific, to make it more easier.
Nathaniel:
Thanks for making this tutorial gamerxgirl. :)
Below are some more specific instructions for this theme, if anyone needs more specific instructions.
Search for
--- Code: --- echo '<li><a' , $current_action=='help' ? ' class="chosen"' : '' , ' href="', $scripturl, '?action=help">' , $txt[119] , '</a></li>';
--- End code ---
Replace with
--- Code: --- 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>';
--- End code ---
Search for
--- Code: ---$current_action = 'search';
--- End code ---
Replace with
--- Code: ---$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';
--- End code ---
Search for
--- Code: ---, 'login', 'help', 'pm'
--- End code ---
Replace with
--- Code: ---, 'login', 'help', 'pm', 'forum', 'spadmin'
--- End code ---
Moved to the 'Custom Theme Tutorials' board.
Navigation
[0] Message Index
Go to full version