The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

New Tab?

View previous topic View next topic Go down

New Tab?

Post by Hagoromo Otsutsuki on December 14th 2014, 7:09 pm

How do I create a new tab for profiles?
My use would be for awards is there any codes?

Hagoromo Otsutsuki
Forumember

Male Posts : 525
Reputation : 21
Language : English
Location : Heaven

http://naruto-omniverse.forumotion.com/

Back to top Go down

Re: New Tab?

Post by JScript on December 15th 2014, 4:26 pm

Hello!
It's simple, but first I need to know some details:
1- The version of your forum;
2- If you use third-party skins nonstandard Forumotion;

See an example for punBB version:
Code:

 // New tab info on advanced perfil (PUNBB)! - By JScript
jQuery(function () {
    if (location.pathname.indexOf('/u') == 0) {
        jQuery('#tabs ul').append('<li id="new_tab" ><a href="javascript:void(0);"><span>New tab</span></a></li>');

        jQuery('#new_tab').click(function () {
         var oldSel = {
               tab: jQuery('#tabs .activetab'),
               html: document.getElementById('profile-advanced-details').innerHTML
            };
            oldSel.tab.removeClass('activetab');
            jQuery('#new_tab').addClass('activetab');
         JS_NewTab();

         oldSel.tab.click(function (event) {
            event.preventDefault();
            jQuery('#new_tab').removeClass('activetab');
            oldSel.tab.addClass('activetab');
            document.getElementById('profile-advanced-details').innerHTML = oldSel.html;
            oldSel.tab.unbind('click');
         });
        });
    }
});

function JS_NewTab() {
    document.getElementById('profile-advanced-details').innerHTML =
        '<div class="main-head">' +
        '    <div class="subtitle">New tab info:</span>' +
        '    </div>' +
        '</div>' +
        '<div class="main-content clearfix">' +
        '    <div class="middleline">' +
        '        <dl id=""><dt>Label 01:</dt>' +
        '            <dd>' +
        '                <span>Description 01...</span>' +
        '            </dd>' +
        '        </dl>' +
        '        <div class="separator">&nbsp;</div>' +
        '        <dl id=""><dt>Label 02:</dt>' +
        '            <dd>' +
        '                <span>Description 02...</span>' +
        '            <dd>' +
        '        </dl>' +
        '        <div class="separator">&nbsp;</div>' +
        '    </div>' +
        '</div>';
};

Result:


Edit:
But it can also be done by editing templates if you wish!

JS


Last edited by JScript on December 15th 2014, 4:48 pm; edited 1 time in total (Reason for editing : More info...)

JScript
Forumember

Male Posts : 741
Reputation : 168
Language : PT-BR, EN
Location : Brazil

http://jscript.forumeiros.com/

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum