Link to Profile-pages ?

erich37

Well-known member
I have a Notice which welcomes the user and I am linking from there to the "User-Account-page" via www.domain.com/account/ in order for the user to easier find his Account.

Is there a way to also link to the user's "Profile-page" ?


Many thanks!
 
The only way to do this without an add-on is to either use {name}.{user_id} or simply {user_id}.

Another problem with {name} is with my name, for example:

<a href="members/{name}.{user_id}">My Profile</a>

Would produce:

<a href="members/Chris Deeming.11388">My Profile</a>

Depending on the browser and server set up, this may cause unpredictable results including the URL being encoded to Chris%20Deeming

My preferred method would be just simply using {user_id}

So:

<a href="members/{user_id}">My Profile</a>

Would produce:

<a href="members/11388">My Profile</a>

The link is automatically converted to the "normal" chris-deeming.11388 on page-load. Really, there's no other way around it...

EDIT: xf_phantom made a good suggestion earlier
 
I know this is an old thread, but I found it while searching for a way to solve a problem of my own. Anyways, if you haven't found another way of doing this and still want the links to be "right", here's how I'd try to do it.

I haven't tested this to see if it will work, but I'm not sure why it wouldn't.

Code:
<xen:set var="$userParam.username">{name}</xen:set>
<xen:set var="$userParam.user_id">{user_id}</xen:set>
<a href="{xen:link 'members', $userParam}">My Profile</a>
 
Are you using that in a template or notice? It won't work in a notice. And you don't need to use xen:set in that context, you can pass it in directly.
 
Are you using that in a template or notice? It won't work in a notice. And you don't need to use xen:set in that context, you can pass it in directly.

Ahh, like I said, I didn't try it. I'm not using that anywhere. I just saw the problem and thought that would fix it. Guess I was wrong. Thanks for pointing it out. ;)
 
Top Bottom