Customizing SMF > Modifications and Packages

Tabbed Profile

(1/1)

shadav:
Link to Mod

This will change your profile page into tabs and rearrange things to make it a bit nicer :)

thanks to this article for the tutorial on how to make tabs : inspirationalpixels.com/creating-tabs-with-html-css-and-jquery

this will not work with other modifications to the profile.template.php
that being said you can make it work by adding more tabs and throwing the modifications into the new tabs
you'd need to add more tab menus by adding them into the

--- Code: ---<ul class="tab-links">
<li class="active"><a href="#tab1">', $txt['userinfo'], '</a></li>
<li><a href="#tab2">', $txt['summary'], '</a></li>
<li><a href="#tab3">', $txt['signature'], '</a></li>
</ul>
--- End code ---
so you'd add

--- Code: ---<li><a href="#tab4">NEW MENU NAME GOES HERE</a></li>
--- End code ---
and then wrap the modification into a tab

--- Code: ---<div id="tab4" class="tab">
MODIFICATION GOES HERE
</div> <!-- #tab4 -->
--- End code ---
if you want it to match and have the cat bar you would do

--- Code: ---<div id="tab4" class="tab">
<div class="cat_bar">
<h3 class="catbg">
<span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/info.gif" alt="NEW MENU NAME GOES HERE" class="icon" />NEW MENU NAME GOES HERE</span>
</h3>
</div>
<div class="windowbg2">
<span class="topslice"><span></span></span>
<div class="content">
MODIFICATION GOES HERE
</div></div>
</div> <!-- #tab4 -->
--- End code ---
change info.gif to whatever image you want to use

and this after

--- Code: ---</div> <!-- #tab3 -->
--- End code ---

you can change the active tab (the default tab that opens on page load)
so let's change it from user info to summary
change

--- Code: ---<li class="active"><a href="#tab1">', $txt['userinfo'], '</a></li>
--- End code ---
to

--- Code: ---<li><a href="#tab1">', $txt['userinfo'], '</a></li>
--- End code ---

change

--- Code: ---<li><a href="#tab2">', $txt['summary'], '</a></li>
--- End code ---
to

--- Code: ---<li class="active"><a href="#tab2">', $txt['summary'], '</a></li>
--- End code ---

change

--- Code: ---<div id="tab1" class="tab active">
--- End code ---
to

--- Code: ---<div id="tab1" class="tab">
--- End code ---

change

--- Code: ---<div id="tab2" class="tab">
--- End code ---
to

--- Code: ---<div id="tab2" class="tab active">
--- End code ---


you can change the style of the buttons with the provided css, I tried to keep it close to the default theme

you can change the animation in the tabbedinfo.js
find

--- Code: ---// Show/Hide Tabs
jQuery('.tabs ' + currentAttrValue).show().siblings().hide();
--- End code ---

replace with one of the below

fade

--- Code: ---// Show/Hide Tabs
jQuery('.tabs ' + currentAttrValue).fadeIn(400).siblings().hide();
--- End code ---

Slide 1

--- Code: ---// Show/Hide Tabs
jQuery('.tabs ' + currentAttrValue).siblings().slideUp(400);
jQuery('.tabs ' + currentAttrValue).delay(400).slideDown(400);
--- End code ---

Slide 2

--- Code: ---// Show/Hide Tabs
jQuery('.tabs ' + currentAttrValue).slideDown(400).siblings().slideUp(400);
--- End code ---

===
added licence (GNU General Public License)
basically do what you like except please do give credit where credit is due...
I'm not really good at scripts and things so :p I welcome anyone who's willing to improve on it

added error=skip to language edits

fixed missing jquery

fixed issue with signature button showing when user has no signature

added a second file, Tabbed_Profile_Lite.zip, for those that may already have installed tabbed info mod

Navigation

[0] Message Index

Go to full version