• 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?

Morgain

Well-known member
#1
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?
 

Morgain

Well-known member
#3
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?
 

Brogan

XenForo moderator
Staff member
#4
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

Well-known member
#6
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.
 

James

Well-known member
#7
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.
use {xen:link members, $user}
 

Morgain

Well-known member
#8
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>
 

James

Well-known member
#9
Try changing members to 'members'. It shouldn't make a difference though. Other than that I'm not sure, where are you using this?
 

Morgain

Well-known member
#12
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 />
 

Jake Bunce

XenForo moderator
Staff member
#14
$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>