1

Topic: Change user menu Profile link to show user's actual profile

Hi,

I'm trying to change the user menu's 'Profile' link (the first one) to show the actual user's profile rather than their 'My page', since 'My page' is already the second link listed.  Want an easy way for users to review their actual profile (say, after edits) rather than having to find their thumbnail some other way to get to their actual profile that others will see.

I'm working on header.tpl however I can't seem to get the reference to the logged in user correct and I have tried several different ways.  This is the line I am working on ...

               
{anchor:url1="account/home/",url2="index.php?m=account_home",name="core|usermenu_outter_profile",class="outter"}

I'm trying to change it to something like this, but it is breaking the site.

{anchor:url1="{session.username}/",url2="index.php?m=account_home",name="core|usermenu_outter_profile",class="outter"}

or

{anchor:url1="<!-- {session.username} -->",url2="index.php?m=account_home",name="core|usermenu_outter_profile",class="outter"}

I'm just not sure how to get the session.username variable working within in the existing { ... } statement.  I was able to get the variable to appear outside of the statement however, so I think I have the right variable.

Also, what is the difference/purpose of url1 versus url2?

Thanks for any advice or suggestions anyone can offer.

Glen

2

Re: Change user menu Profile link to show user's actual profile

Hi,

an easy way for example, you could also edit account_home.tpl.

Add...

<li><a href="{virtual_path}{member_profile_link}">user's profile</a></li>

between or where you want at...

<li>{anchor:url1="account/home/",url2=...
<li>{anchor:url1="account/profile/",url2=...
<li>{anchor:url1="account/photo/",url2=...

regards

3

Re: Change user menu Profile link to show user's actual profile

Thanks for this solution champagnero.  I appreciate this idea and will probably try it.

However, if anyone can tell me how to get the 'session.username' working in the original snippet of script, I would appreciate knowing for future reference.  I seem to be having trouble using the variable within the {anchor: ... } statement.

I am still of the opinion that the user menu 'Profile' link should show the users actual profile rather then duplicate the 'My page' link that is right below it.

Thanks,
Glen

4

Re: Change user menu Profile link to show user's actual profile

Hello all,

Just to let you know I have made some progress with my challenge.  The following code has change my user menu 'Profile' link to call up the users actual profile provided I am using "Search Friendly URLs" (url1) ...

{anchor:url1=session.username,url2="index.php?m=member_profile&p=profile&id=session.id",name="core|usermenu_outter_profile",class="outter"}

I wasn't able to use any quotes (' or ") around session.username as it seemed to break the script or the anchor function.

I attempted to also solve the same challenge for url2 used for "Search UN-Friendly URLs", but I wasn't able to get it working with session.id.  I just can get the users id to show up in the url2 url -- instead, I just see session.id in the resulting url.

So, if someone knows the best way to get session variables such as session.username and session.id to so up properly while within a {anchor: ... }, please let me know.  I'm not sure if I've done this the right way, but as long as I use Search Friendly URLs, then my method for url1 will server my purpose.

Vlad, do you have any advice on this?

Thanks,
Glen