1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to make the Information Tab the First Tab (Member Profile)

Discussion in 'XenForo Questions and Support' started by Richey, May 4, 2011.

  1. Richey

    Richey Member

    Hey guys,

    is there a way to make the Information Tab the first Tab on a member profile?

    Thx!
     
  2. Richey

    Richey Member

    Mmmhhhh not possible?
     
  3. Brogan

    Brogan XenForo Moderator Staff Member

    I tried and couldn't get it to work.

    There doesn't seem to be any way of doing it from the templates.
    It will most likely require editing a .php file.
     
  4. ragtek

    ragtek Guest

    You would just need to edit the member_view template and move some code, BUT

    i've tried it and it seems that there is some javascript conflict.
    I need to check first, why this happens, then i'll post the howto
     
    Richey likes this.
  5. Richey

    Richey Member

    That would be great, thank you!
     
  6. Nasr

    Nasr Well-Known Member

    Instead of having it the first tab. Why not just have it the selected tab instead? Maybe it would be much easier that way?
     
  7. Richey

    Richey Member

    Hehe, may be, but how to do this? :) There seems to be no "selected" attribute in the code.
     
  8. ragtek

    ragtek Guest

    AFAIK that's not possible:(
     
  9. Tilkißey

    Tilkißey Well-Known Member

    member_view template
    these codes are tabs' names' listing order

    HTML:
    <ul class="tabs mainTabs Tabs" data-panes="#ProfilePanes > li" data-history="on">
    <li><a href="{$requestPaths.requestUri}#profilePosts">{xen:phrase profile_posts}</a></li>
    <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>
    <li><a href="{$requestPaths.requestUri}#info">{xen:phrase information}</a></li>
    <xen:hook name="member_view_tabs_heading" params="{xen:array 'user={$user}'}" />
    </ul>
    so, your new order will be like that
    HTML:
    <ul class="tabs mainTabs Tabs" data-panes="#ProfilePanes > li" data-history="on">
    <li><a href="{$requestPaths.requestUri}#profilePosts">{xen:phrase profile_posts}</a></li>
    <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>
    <li><a href="{$requestPaths.requestUri}#info">{xen:phrase information}</a></li>
    <xen:hook name="member_view_tabs_heading" params="{xen:array 'user={$user}'}" />
    </ul>
    but, it isnt enough
    you have to re-order
    HTML:
    <li id="info" class="profileContent">....</li>
    code
    so, find these codes
    HTML:
    <li id="info" class="profileContent">
    
    <xen:if is="{$user.signature}">
    <div class="section">
    <h3 class="textHeading">{xen:phrase signature}</h3>
    <div class="primaryContent">
    <div class="baseHtml signature ugc">{xen:raw $user.signatureHtml}</div>
    </div>
    </div>
    </xen:if>
    
    <xen:if hascontent="true">
    <div class="section">
    <h3 class="textHeading">{xen:phrase about}</h3>
    
    <div class="secondaryContent">
    <xen:contentcheck>
    <xen:if hascontent="true">
    <div class="pairsColumns aboutPairs">
    <xen:contentcheck>
    <xen:if is="{$user.gender}">
    <dl><dt>{xen:phrase gender}:</dt> <dd><xen:if is="{$user.gender} == 'male'">{xen:phrase male}<xen:else />{xen:phrase female}</xen:if></dd></dl>
    </xen:if>
    
    <xen:if is="{$birthday}">
    <dl><dt>{xen:phrase birthday}:</dt> <dd>{xen:date $birthday.timeStamp, $birthday.format} <xen:if is="{$birthday.age}">({xen:phrase age}: {xen:number $birthday.age})</xen:if></dd></dl>
    </xen:if>
    
    <xen:if is="{$user.homepage}">
    <dl><dt>{xen:phrase home_page}:</dt> <dd><a href="{xen:string censor, $user.homepage}" rel="nofollow" target="_blank">{xen:string censor, $user.homepage}</a></dd></dl>
    </xen:if>
    
    <xen:if is="{$user.location}">
    <dl><dt>{xen:phrase location}:</dt> <dd>{xen:string censor, $user.location}</dd></dl>
    </xen:if>
    
    <xen:if is="{$user.occupation}">
    <dl><dt>{xen:phrase occupation}:</dt> <dd>{xen:string censor, $user.occupation}</dd></dl>
    </xen:if>
    </xen:contentcheck>
    </div>
    </xen:if>
    
    <xen:if is="{$user.about}"><div class="baseHtml ugc">{xen:raw $user.aboutHtml}</div></xen:if>
    </xen:contentcheck>
    </div>
    </div>
    </xen:if>
    
    <div class="section">
    <h3 class="textHeading">{xen:phrase interact}</h3>
    
    <div class="primaryContent">
    <div class="pairsColumns contactInfo">
    <dl>
    <dt>{xen:phrase content}:</dt>
    <dd><ul>
    <li><a href="{xen:link search/member, '', 'user_id={$user.user_id}'}">{xen:phrase find_all_content_by_x, 'name={$user.username}'}</a></li>
    <li><a href="{xen:link search/member, '', 'user_id={$user.user_id}', 'content=thread'}">{xen:phrase find_all_threads_by_x, 'name={$user.username}'}</a></li>
    </ul></dd>
    </dl>
    <xen:if is="{$canStartConversation}">
    <dl><dt>{xen:phrase conversation}:</dt> <dd><a href="{xen:link 'conversations/add', '', 'to={$user.username}'}">{xen:phrase start_conversation}</a></dd></dl>
    </xen:if>
    <xen:if is="{$identities}">
    <xen:foreach loop="$identities" value="$identity">
    <dl><dt>{$identity.title}:</dt> <dd>{xen:string censor, $identity.value}</dd></dl>
    </xen:foreach>
    </xen:if>
    </div>
    </div>
    </div>
    </li>
    and move to this code's below
    HTML:
    <ul id="ProfilePanes">
     
    Breixo, Lilie and Brogan like this.
  10. ragtek

    ragtek Guest

    Does this work for you?
    Do you have no errors in your js console?
    I'm getting
    Code:
    uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMNSHTMLTextAreaElement.selectionStart]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: [URL]http://localhost/xenforo/js/xenforo/xenforo.js?_v=fc20a874[/URL] :: anonymous :: line 6122" data: no]
    It's something because of the editor:/
     
  11. Tilkißey

    Tilkißey Well-Known Member

    it works in localhost
    and, i didnt get any error
    i wrote something to user's profile page and it sent
     
    ragtek likes this.
  12. ragtek

    ragtek Guest

    ok thx:)

    strange that i receive this error:/
     
    Tilkißey likes this.
  13. Brogan

    Brogan XenForo Moderator Staff Member

    Nice work Mr Fox.

    I'm sure I tried that though :confused:
     
    Tilkißey likes this.
  14. Phillip

    Phillip Active Member

    I tried to make these changes. The good news is that the content of the default tab changed to show what's in the "information" page. However the selected tab is still "profile posts" and not "information". Attached is a screenshot to visualize what's happening.

    Here is my code...
    Code:
    <ul class="tabs mainTabs Tabs" data-panes="#ProfilePanes > li" data-history="on">
                    <li><a href="{$requestPaths.requestUri}#profilePosts">{xen:phrase profile_posts}</a></li>
                    <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>
                    <li><a href="{$requestPaths.requestUri}#info">{xen:phrase information}</a></li>
                    <xen:hook name="member_view_tabs_heading" params="{xen:array 'user={$user}'}" />
                </ul>
            </div>
    
            <ul id="ProfilePanes">
    
    <!-- MC Custom change profile tabs-->
                        <li id="info" class="profileContent">
    
                    <xen:if is="{$user.signature}">
                        <div class="section">
                            <h3 class="textHeading">{xen:phrase signature}</h3>
                            <div class="primaryContent">
                                <div class="baseHtml signature ugc">{xen:raw $user.signatureHtml}</div>
                            </div>
                        </div>
                    </xen:if>
    
                    <xen:if hascontent="true">
                        <div class="section">
                            <h3 class="textHeading">{xen:phrase about}</h3>
    
                            <div class="secondaryContent">
                                <xen:contentcheck>
                                    <xen:if hascontent="true">
                                        <div class="pairsColumns aboutPairs">
                                        <xen:contentcheck>
                                            <xen:if is="{$user.gender}">
                                                <dl><dt>{xen:phrase gender}:</dt> <dd><xen:if is="{$user.gender} == 'male'">{xen:phrase male}<xen:else />{xen:phrase female}</xen:if></dd></dl>
                                            </xen:if>
    
                                            <xen:if is="{$birthday}">
                                                <dl><dt>{xen:phrase birthday}:</dt> <dd>{xen:date $birthday.timeStamp, $birthday.format} <xen:if is="{$birthday.age}">({xen:phrase age}: {xen:number $birthday.age})</xen:if></dd></dl>
                                            </xen:if>
    
                                            <xen:if is="{$user.homepage}">
                                                <dl><dt>{xen:phrase home_page}:</dt> <dd><a href="{xen:string censor, $user.homepage}" rel="nofollow" target="_blank">{xen:string censor, $user.homepage}</a></dd></dl>
                                            </xen:if>
    
                                            <xen:if is="{$user.location}">
                                                <dl><dt>{xen:phrase location}:</dt> <dd>{xen:string censor, $user.location}</dd></dl>
                                            </xen:if>
    
                                            <xen:if is="{$user.occupation}">
                                                <dl><dt>{xen:phrase occupation}:</dt> <dd>{xen:string censor, $user.occupation}</dd></dl>
                                            </xen:if>
                                        </xen:contentcheck>
                                        </div>
                                    </xen:if>
    
                                    <xen:if is="{$user.about}"><div class="baseHtml ugc">{xen:raw $user.aboutHtml}</div></xen:if>
                                </xen:contentcheck>
                            </div>
                        </div>
                    </xen:if>
    
                    <div class="section">
                        <h3 class="textHeading">{xen:phrase interact}</h3>
    
                        <div class="primaryContent">
                            <div class="pairsColumns contactInfo">
                                <dl>
                                    <dt>{xen:phrase content}:</dt>
                                    <dd><ul>
                                        <xen:hook name="member_view_search_content_types">
                                        <li><a href="{xen:link search/member, '', 'user_id={$user.user_id}'}">{xen:phrase find_all_content_by_x, 'name={$user.username}'}</a></li>
                                        <li><a href="{xen:link search/member, '', 'user_id={$user.user_id}', 'content=thread'}">{xen:phrase find_all_threads_by_x, 'name={$user.username}'}</a></li>
                                        </xen:hook>
                                    </ul></dd>
                                </dl>
                                <xen:if is="{$canStartConversation}">
                                    <dl><dt>{xen:phrase conversation}:</dt> <dd><a href="{xen:link 'conversations/add', '', 'to={$user.username}'}">{xen:phrase start_conversation}</a></dd></dl>
                                </xen:if>
                                <xen:if is="{$identities}">
                                    <xen:foreach loop="$identities" value="$identity">
                                        <dl><dt>{$identity.title}:</dt> <dd>{xen:string censor, $identity.value}</dd></dl>
                                    </xen:foreach>
                                </xen:if>
                            </div>
                        </div>
                    </div>
                </li>
    <!-- End Custom -->
    
                <li id="profilePosts" class="profileContent">
    
                <xen:if is="{$canViewProfilePosts}">
                    <xen:require css="message_simple.css" />
    
                    <xen:if is="{$canPostOnProfile}">
                        <form action="{xen:link members/post, $user}" method="post"
                            class="messageSimple profilePoster AutoValidator primaryContent" id="ProfilePoster"
     

    Attached Files:

  15. Tilkißey

    Tilkißey Well-Known Member

    you have to move the "info" tab's codes as like as i wrote in the explaining message

    see my post for this lines' below
     
  16. tommydamic68

    tommydamic68 Well-Known Member

    There is no change in those two codes above, there identical. So just putting this code:
    <ul id="ProfilePanes"> below what is the only edit here?
     
  17. tommydamic68

    tommydamic68 Well-Known Member

    Ok - got it after awhile, not so clear directions. Now, I want to move the about to the top, i figured out to just move the code above occupation but How can I code a proper space between? It looks cluttered and on top of the occupation info. a <br />?
    Code:
    <xen:if is="{$user.about}"><div class="baseHtml ugc">{xen:raw $user.aboutHtml}</div></xen:if>
    Screen Shot 2013-10-20 at 7.28.01 AM.png
     

Share This Page