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

XF 1.1 Disabling Custom Title From Being Shown

Discussion in 'XenForo Questions and Support' started by Yoshi910, Jul 23, 2012.

  1. Yoshi910

    Yoshi910 Member

    How do I disable the custom title from being shown in threads, but still have a custom title assigned?
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Admin CP -> Appearance -> Templates -> message_user_info

    Add the red code:

    Code:
    <xen:if is="!{$isQuickReply}">
    	<xen:hook name="message_user_info_text" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
    		<h3 class="userText">
    			<xen:username user="$user" itemprop="name" rich="true" />
    			<xen:if hascontent="true"><em class="userTitle" itemprop="title"><xen:contentcheck>{xen:helper userTitle, $user, 0}</xen:contentcheck></em></xen:if>
    			<!-- slot: message_user_info_text -->
    		</h3>
    	</xen:hook>
    
     
    Malo likes this.
  3. Yoshi910

    Yoshi910 Member

    Does this still work in xenForo 1.1.3? It does not seem to be working for me.
     
  4. Malo

    Malo Member

    you putting a space between , and 0? and are you in the right skin template?
     
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Yes it does.

    Malo has a good suggestion... make sure you are editing the same style you are viewing.
     
  6. MagnusB

    MagnusB Well-Known Member

    If you upgraded and reverted any templates, your edits has been undone and you have to redo them.
     
  7. Yoshi910

    Yoshi910 Member

    I don't know what's wrong.

    Code:

    Code:
    <xen:require css="message_user_info.css" />
     
    <div class="messageUserInfo" itemscope="itemscope" itemtype="http://data-vocabulary.org/Person">   
    <div class="messageUserBlock">
        <xen:hook name="message_user_info_avatar" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
            <div class="avatarHolder">
                <span class="helper"></span>
                <xen:avatar user="$user" size="m" />
                <!-- slot: message_user_info_avatar -->
            </div>
        </xen:hook>
     
    <xen:if is="!{$isQuickReply}">
        <xen:hook name="message_user_info_text" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
            <h3 class="userText">
                <xen:username user="$user" itemprop="name" rich="true" />
                <xen:if hascontent="true"><em class="userTitle" itemprop="title"><xen:contentcheck>{xen:helper userTitle, $user, 0}</xen:contentcheck></em></xen:if>
                <!-- slot: message_user_info_text -->
            </h3>
        </xen:hook>
       
    <xen:if hascontent="true">
    <ul class="badge">
    <xen:contentcheck>
     
    <xen:if is="{xen:helper ismemberof, $user, 3}">
    <li class="badgeOwner">
    </li>
    </xen:if>
     
    <xen:if is="{xen:helper ismemberof, $user, 12}">
    <li class="badgeAdmin">
    </li>
    </xen:if>
     
    <xen:if is="{xen:helper ismemberof, $user, 4}">
    <li class="badgeMod">
    </li>
    </xen:if>
     
    <xen:if is="{xen:helper ismemberof, $user, 13}">
    <li class="badgeTempMod">
    </li>
    </xen:if>
     
    <xen:if is="{xen:helper ismemberof, $user, 2}">
    <li class="badgeMember">
    </li>
    </xen:if>
     
    <xen:if is="{xen:helper ismemberof, $user, 7}">
    <li class="badgeDonor">
    </li>
    </xen:if>
     
    <xen:if is="{xen:helper ismemberof, $user, 8}">
    <li class="badgeVIP">
    </li>
    </xen:if>
     
    <xen:if is="{xen:helper ismemberof, $user, 9}">
    <li class="badgeVIP2">
    </li>
    </xen:if>
     
    <xen:if is="{xen:helper ismemberof, $user, 10}">
    <li class="badgeSponsor">
    </li>
    </xen:if>
     
    <xen:if is="{xen:helper ismemberof, $user, 11}">
    <li class="badgePlatinum">
    </li>
    </xen:if>
     
    </xen:contentcheck>
    </ul>
    </xen:if>
           
        <xen:if hascontent="true">
            <div class="extraUserInfo">
                <xen:contentcheck>
                <xen:hook name="message_user_info_extra" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
                    <xen:if is="@messageShowRegisterDate">
                        <dl class="pairsInline">
                            <dt>{xen:phrase member_since}:</dt>
                            <dd>{xen:date $user.register_date}</dd>
                        </dl>
                    </xen:if>
                   
                    <xen:if is="@messageShowMessageCount">
                        <dl class="pairsInline">
                            <dt>{xen:phrase message_count}:</dt>
                            <dd><a href="{xen:link search/member, '', 'user_id={$user.user_id}'}" class="concealed">{xen:number $user.message_count}</a></dd>
                        </dl>
                    </xen:if>
                   
                    <xen:if is="@messageShowTotalLikes">
                        <dl class="pairsInline">
                            <dt>{xen:phrase likes_received}:</dt>
                            <dd>{xen:number $user.like_count}</dd>
                        </dl>
                    </xen:if>
                   
                    <xen:if is="@messageShowTrophyPoints">
                        <dl class="pairsInline">
                            <dt>{xen:phrase trophy_points}:</dt>
                            <dd><a href="{xen:link 'members/trophies', $user}" class="OverlayTrigger concealed">{xen:number $user.trophy_points}</a></dd>
                        </dl>
                    </xen:if>
               
                    <xen:if is="@messageShowGender AND {$user.gender}">
                        <dl class="pairsInline">
                            <dt>{xen:phrase gender}:</dt>
                            <dd itemprop="gender"><xen:if is="{$user.gender} == 'male'">{xen:phrase male}<xen:else />{xen:phrase female}</xen:if></dd>
                        </dl>
                    </xen:if>
                   
                    <xen:if is="@messageShowOccupation AND {$user.occupation}">
                        <dl class="pairsInline">
                            <dt>{xen:phrase occupation}:</dt>
                            <dd itemprop="role">{xen:string censor, $user.occupation}</dd>
                        </dl>
                    </xen:if>
                   
                    <xen:if is="@messageShowLocation AND {$user.location}">
                        <dl class="pairsInline">
                            <dt>{xen:phrase location}:</dt>
                            <dd><a href="{xen:link 'misc/location-info', '', 'location={xen:string censor, $user.location, '-'}'}" target="_blank" rel="nofollow" itemprop="address" class="concealed">{xen:string censor, $user.location}</a></dd>
                        </dl>
                    </xen:if>
               
                    <xen:if is="@messageShowHomepage AND {$user.homepage}">
                        <dl class="pairsInline">
                            <dt>{xen:phrase home_page}:</dt>
                            <dd><a href="{xen:string censor, $user.homepage, '-'}" rel="nofollow" target="_blank" itemprop="url">{xen:string censor, $user.homepage}</a></dd>
                        </dl>
                    </xen:if>
                               
                </xen:hook>           
                <xen:if is="@messageShowCustomFields AND {$user.customFields}">
                <xen:hook name="message_user_info_custom_fields" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
               
                    <xen:foreach loop="$userFieldsInfo" key="$fieldId" value="$fieldInfo">
                        <xen:if is="{$fieldInfo.viewable_message}">
                            <xen:if hascontent="true">
                                <dl class="pairsInline userField_{$fieldId}">
                                    <dt>{xen:helper userFieldTitle, $fieldId}:</dt>
                                    <dd><xen:contentcheck>{xen:helper userFieldValue, $fieldInfo, $user, {$user.customFields.{$fieldId}}}</xen:contentcheck></dd>
                                </dl>
                            </xen:if>
                        </xen:if>
                    </xen:foreach>
                   
                </xen:hook>
                </xen:if>
                </xen:contentcheck>
            </div>
        </xen:if>
           
    </xen:if>
     
        <span class="arrow"><span></span></span>
    </div>
    </div>
    I have verified I am editing the correct template. So I am guessing it's a problem with the code.
     
  8. ENF

    ENF Well-Known Member

    The above code works, it removes the custom user title from posts but reverts back to the standard user titles either assigned by a group or user ladder titles.
     
  9. Yoshi910

    Yoshi910 Member

    Ahh, that is why it is not working.

    How do I disable standard user titles?
     
  10. ENF

    ENF Well-Known Member

    My guess would be to delete the default titles in the ACP.

    ACP > Users > Trophy User Titles > [Delete all available Titles]

    I tested this quickly and using the template modification on above, plus removing the default titles...

    Results in no user title on posts.

    xf_20120911_2351.JPG
     
  11. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    You could remove that entire line:

    Code:
    <xen:if hascontent="true"><em class="userTitle" itemprop="title"><xen:contentcheck>{xen:helper userTitle, $user, 0}</xen:contentcheck></em></xen:if>
    
     
  12. Yoshi910

    Yoshi910 Member

    Worked great ;)
     

Share This Page