1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Adding own Tabs to the Member Page

Discussion in 'Development Tutorials [Archive]' started by ragtek, Oct 21, 2010.

  1. ragtek

    ragtek Guest

    This Tutorial shows you, how to add own Tabs to your Members Profile Page.
    [Works with XenForo 1.0.0 Beta 1]

    I'm calling my tab "ragtek" so search the code for ragtek and replace it with your unique name;)

    1 Add a Phrase for the tab (i'll call my mytab)
    2. Edit your template member_view
    Search for
    <ul class="tabs mainTabs Tabs" data-panes="#ProfilePanes > li" data-history="on">
                    <li><a href="{$requestPaths.requestUri}#profilePosts">{xen:phrase profile_posts}</a>
                    <xen:if is="{$showRecentActivity}"><li><a href="{$requestPaths.requestUri}#recentActivity">{xen:phrase recent_activity}</a></li></xen:if>
                    <li><a href="{$requestPaths.requestUri}#postings">{xen:phrase postings}</a>
                    <li><a href="{$requestPaths.requestUri}#info">{xen:phrase information}</a>
    Add under this
     <li><a href="{$requestPaths.requestUri}#ragtek">{xen:phrase mytab}</a></li>
                                <xen:if is="{$identities}">
                                    <xen:foreach loop="$identities" value="$identity">
                                        <dl><dt>{$identity.title}:</dt> <dd>{xen:string censor, $identity.value}</dd></dl>
    add under this
    <li id="ragtek" class="profileContent">
               <div class="section">Your content</div>
    Instead of Your content, you can use phrases, or extend the member Controller
    Vodkaholic and Rob Fritz like this.
  2. ragtek

    ragtek Guest

    If you have a "heavy/ slow" tab, you could use ajax, to load the tab only if somebody clicks on it;)

    You have to add a data-loadUrl Parameter to the li element
    for example
    <li id="postings" class="profileContent" data-loadUrl="{xen:link members/recent-content, $user}">
  3. dmnkhhn

    dmnkhhn Active Member

    Do we have to use a special view in the controller when using the data-loadUrl or is XenForo smart enough to delete all the stuff from the template that we don't need when the content should be loaded inside that tab?
  4. ragtek

    ragtek Guest

    The tutorial is outdated.

    You can ignore step 2 and use template hooks member_view_tabs_heading AND member_view_tabs_content to add the additional tabs and content

Share This Page