When I view "My account" page, I see the following

* view * edit * track * contact

If I want to place a link in the primary link so that the visitor can immediately be linked to "edit my account",

how do I create such a link?

my webpage is http://www.medicpark.com

Please assist.

Thanks.

Comments

pobster’s picture

Here's an example (4.7) of some things you can do:

  global $user;
  print "Hello {$user->profile_name}! Welcome to the site,";
  print "<p><ul><li>Change your <a href='/user/$user->uid/notify'>notify</a> settings</li><li><a href='/user/$user->uid/edit/newsletter'>Subscribe</a> to the newletter</li><li>View your <a href='/store/history/$user->uid'>Order History</a></li></ul></p>";

Nb. The $user->profile_name is something I created myself using the profile module.

Pobster

medicpark’s picture

Thanks for your reply. Will try it soon.

Website: http://www.medicpark.com
Email: mail@medicpark.com

nevets’s picture

To make the code work with or without clean URLs you want to call the l() function (that's a lower case L). So

print "<p><ul><li>Change your <a href='/user/$user->uid/notify'>notify</a> settings</li><li><a href='/user/$user->uid/edit/newsletter'>Subscribe</a> to the newletter</li><li>View your <a href='/store/history/$user->uid'>Order History</a></li></ul></p>";

would become

print "<p><ul><li>" . l(t('Change your notify settings'), "user/$user->uid/notify") . '</li><li>' . l(t('Subscribe to the newsletter'), "user/$user->uid/edit/newsletter") . '</li><li>View your . l(t('Order History'), "store/history/$user->uid") . '</li></ul></p>';

Note I made the whole phrase the link instead of a single word, not required but it makes it easier to be translatable.