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

Short form of site URL?

Discussion in 'XenForo Questions and Support' started by Morgain, Dec 6, 2011.

  1. Morgain

    Morgain Well-Known Member

    I learned that there is a short form of the path to images.
    e.g.
    Code:
    <img src="@imagePath/xenforo/widgets/catbar1.png" />
    Can I use something similar for doing a link to a standard XF page.
    Example - What's New?
    Full link:
    Code:
    http://www.mysite.com/forum/index.php?find-new/threads 
    Can I cut out the domain part of the site, and use something that points at the XF directory?
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Morgain and Floris like this.
  3. Morgain

    Morgain Well-Known Member

    Thank you Brogan. That works for most of them.
    The one I can't get is the Recent Threads (all recent read and unread)

    I tried
    Code:
    <a href="{xen:link 'find-new/threads'}">{xen:phrase recent_threads}</a>
    which is the Phrase
    but it just gets Whats New?
    Page Source gives me
    Code:
    <div id="content" class="find_new_threads">
    but that phrase find_new_threads doesn't work.
    Whatever I try I just get Whats New?
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    Use this instead:
    Code:
    <li><a href="{xen:link 'find-new/threads', '', 'days=7'}">{xen:phrase latest_threads}</a></li>
    Change the 7 to the number of days required.

    You can either create the latest_threads phrase or use an existing one.
     
    Morgain likes this.
  5. Morgain

    Morgain Well-Known Member

    Thank you.
    Just in case it helps someone else I used recent_threads which works fine.
     
    Fuhrmann likes this.
  6. Morgain

    Morgain Well-Known Member

    Now I'm trying to identify the URL to use for the Profile Page.

    Its URL only gives me "members"
    Code:
    <a href="{xen:link 'members'}"> {xen:phrase profile_page}</a>
    gets the Members list.

    From its View Source I got member_view but
    Code:
    <a href="{xen:link 'member_view'}"> {xen:phrase profile_page}</a>
    got an error message.
     
  7. James

    James Well-Known Member

    use {xen:link members, $user}
     
    Morgain likes this.
  8. Morgain

    Morgain Well-Known Member

    Bless you James with choirs of angels in the gender of your taste all bearing chocolate cake and mead on golden trays.

    Spoke too soon. That's still getting the Members list. Angels still waiting on standby though.

    Code:
    <a href="{xen:link members, $user}"> {xen:phrase profile_page}</a>
     
    Fuhrmann likes this.
  9. James

    James Well-Known Member

    Try changing members to 'members'. It shouldn't make a difference though. Other than that I'm not sure, where are you using this?
     
  10. Morgain

    Morgain Well-Known Member

    It's in an XF Page.
    No the commas made no difference.
     
  11. James

    James Well-Known Member

    Use this: {xen:helper dump, $user}

    Does it return an array of values, or does it return NULL?
     
    Morgain likes this.
  12. Morgain

    Morgain Well-Known Member

    I'll put the complete section in. Perhaps something tiny is wrong.

    Code:
    <img src="http://www.housemorgain.co.uk/forumxf/styles/default/xenforo/widgets/star20.png" /> MY PROFILE <a href="{xen:link 'members', $user}"> {xen:phrase profile_page}</a><br />
     
  13. Morgain

    Morgain Well-Known Member

    Sorry James that's a new trick to me.How do you want me to use that?
     
  14. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    $user probably doesn't contain anything. If you want to create a link for the current logged in user then use $visitor:

    Code:
    <a href="{xen:link members, $visitor}"> {xen:phrase profile_page}</a>
    
     
    Morgain and James like this.
  15. Morgain

    Morgain Well-Known Member


    YAY! Working. Thank you both of you.
     
    Fuhrmann likes this.

Share This Page