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

Adding Certain Profile Fields to Member Card

Discussion in 'Styling and Customization Questions' started by Ranger375, Nov 17, 2011.

  1. Ranger375

    Ranger375 Well-Known Member

    Is this possible? If so, how? :D
  2. Jake Bunce

    Jake Bunce Probably knows the answer Staff Member

    Admin CP -> Appearance -> Templates -> member_card

    Add the red code near the bottom:

    Code:
    		<xen:if is="{$canViewOnlineStatus}">
    			<dl class="pairsInline lastActivity">
    				<dt>{xen:phrase x_was_last_seen, 'username={$user.username}'}:</dt>
    				<dd>
    					<xen:if is="{$user.activity}">
    						<xen:if is="{$user.activity.description}">
    							{$user.activity.description}<xen:if is="{$user.activity.itemTitle}"> <em><a href="{$user.activity.itemUrl}" class="concealed">{$user.activity.itemTitle}</a></em></xen:if>,
    						<xen:else />
    							{xen:phrase viewing_unknown_page},
    						</xen:if>
    						<xen:datetime time="{$user.effective_last_activity}" class="muted" />
    					<xen:else />
    						<xen:datetime time="{$user.effective_last_activity}" />
    					</xen:if>
    				</dd>
    			</dl>
    		</xen:if>
    		<xen:if hascontent="true">
    			<dl class="pairsColumns lastActivity">
    			<xen:contentcheck>
    				<xen:if is="{$user.customFields.field_id}">
    					<dt>Field Name:</dt>
    					<dd>{$user.customFields.field_id}</dd>
    				</xen:if>
    			</xen:contentcheck>
    			</dl>
    		</xen:if>
    	</div>
    	
    	<a class="close OverlayCloser"></a>
    </div>
    
    You need to specify the field_id of the profile field, and type in the Field Name to give it a label. You can add more instances of the blue code inside of the red code to show multiple fields.

    The result:

    Screen shot 2011-11-20 at 1.10.37 PM.png
    dwdmadmac, Andrej, Shelley and 6 others like this.
  3. Ranger375

    Ranger375 Well-Known Member

    Awesome, thank you
  4. JamesBrown

    JamesBrown Active Member

    How could I show the users Unique ID number here? Thanks
  5. Jake Bunce

    Jake Bunce Probably knows the answer Staff Member

    The user_id?

    Code:
    {$user.user_id}
    

Share This Page