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

XF 1.4 Profile Page: How to add information from under "Information" to another location?

Discussion in 'Styling and Customization Questions' started by hyperthreadz, Jul 9, 2015.

  1. hyperthreadz

    hyperthreadz Member

    We have information in options for our users such as "Real Name" - see attached screenshot.
    The red is the ones we actively have.
    The green (where the arrow is pointing to) is where we'd like the Real Name to be added to. profile.png
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    You would have to edit the template(s).

    The FAQ in my signature explains how to identify the template name of the page being viewed.
     
  3. hyperthreadz

    hyperthreadz Member

    I am aware that certain templates need to be edited.

    Have I posted to the wrong forum? If so, please direct me to the correct forum.
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    This is the correct forum.

    As I explained, you will need to identify the template(s) you wish to edit, which the FAQ in my signature explains how to do.
     
  5. hyperthreadz

    hyperthreadz Member

    Not to mean any disrespect, but I figured it out on my own. Suggesting to look at some FAQs and sifting through pages to find some solution to an answer is not very helpful (I know it sounds and probably is helpful to someone who is new to programming/coding/Xenforo). I know you mean well about it when people use your guides and search the FAQs, but when time is valuable, a quick answer helps. :) While my post count might be low, I have been coding for 15 years (using vBulletin for most of it).

    Having said that, if anyone else has this issue, here is what helped me (since I am one to assist others).

    I tested a snippet in one template (for postbit) and then in the profile, which worked.

    Edit template: message_user_info
    Find:
    Code:
    <xen:if is="@messageShowRegisterDate AND {$user.user_id}">
                        <dl class="pairsJustified">
                            <dt>{xen:phrase joined}:</dt>
                            <dd>{xen:date $user.register_date}</dd>
                        </dl>
                    </xen:if>
    
    Add before:
    Code:
    <xen:if is="@messageShowRegisterDate AND {$user.user_id}">
                        <dl class="pairsJustified">
                            <dt>Real Name:</dt>
                            <dd>{$user.customFields.real_name}</dd>
                        </dl>
                    </xen:if>
    

    Then, edit template: member_view

    Find:
    Code:
    <xen:hook name="member_view_info_block">
    
    Add after:
    Code:
    <dl><dt>Real Name:</dt>
                        <dd>{$user.customFields.real_name}</dd></dl>
    

    Again, I mean no disrespect. Time is just important to me as I work two jobs.
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

    The FAQs exist for a reason - to save me and others having to post the same thing over and over again.

    I also work several jobs, hence why I created the FAQs, at considerable time and effort.
     

Share This Page