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

XF 1.3 Show author homepage link (too long)

Discussion in 'Styling and Customization Questions' started by audiokid, Apr 4, 2014.

  1. audiokid

    audiokid Active Member

    Some people have really long url!

    I'm wondering how to modify or is there an add-on to make a clean link for,
    admin.php?styles/default-style.37/style-properties&group=message area?

    Show author homepage link
    Display a link to the homepage of the message author, if they have entered one.

    A simple box that was easy for members to add in their url and website name would look much better on the forum.

    Code:
    <a href="http://www.yourlink.com/">your link</a> 
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Admin CP -> Appearance -> Templates -> message_user_info

    This is the relevant code:

    Code:
    				<xen:if is="@messageShowHomepage AND {$user.homepage}">
    					<dl class="pairsJustified">
    						<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>
    
     
  3. audiokid

    audiokid Active Member

    Hi Jake, thanks for chiming in. Do I need to insert this in a particular order or location? Will the code I have be enough to create the needed box for users?
     
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    That code already exists in the default template. The HTML can be modified to create hyperlinked text instead of showing the entire URL as the text, which I believe is what you want.
     
  5. audiokid

    audiokid Active Member

    Exactly, but I am wondering how I would include/ modify this in the current code? I'm suprized xenForo hasn't included this in there already stellar/ clean looking forum. I think this is an overlooked feature. So many people have long strings.
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

    Change it to this:
    Code:
    <xen:if is="@messageShowHomepage AND {$user.homepage}">
        <dl class="pairsJustified">
            <dt>{xen:phrase home_page}:</dt>
            <dd><a href="{xen:string censor, $user.homepage, '-'}" rel="nofollow" target="_blank" itemprop="url">My Homepage</a></dd>
        </dl>
    </xen:if>
    Adjust "My Homepage" to suit.
     
    audiokid and PaulK like this.
  7. audiokid

    audiokid Active Member

    Nice!
    one more thing . "My Homepage" is on the right. To force it to the left would we just add ?
     
  8. Amaury

    Amaury Well-Known Member

    Try text-align: left !important; with the appropriate class name in EXTRA.css.
     
  9. audiokid

    audiokid Active Member

    Could this be included in the next update? Or why has it not? :)
     

Share This Page