Forums: Adding a link to user profile to the menu - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Adding a link to user profile to the menu

#1 User is offline   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 16045
  • Joined: 03-February 03

Posted 12 July 2013 - 10:05 PM

Here is the situation - you want to give each user a quick access to her own data in users table. It would be nice to add 'My profile' link right to the main menu.

Link to user profile page looks like users_edit.asp?editid1=XXXX. We assume that login table name is users and XXXX is the value of primary key field in users table.

1. Save ID of user account in session variable. For this purpose add the following code to AfterSuccessfulLogin event
SESSION("user_id")=data("id")


In this example id is a primary key column name in login table.

2. Create a new menu item via Menu Builder.
Link type: Application page
Link to: Users (login table) List page
Link text: My profile

3. Now add the following code to MenuItem: Modify event

if menuItem.getTitle()="My profile" then
	menuItem.setUrl_p1("users_edit.asp?editid1=" & Session("user_id"))
end if

ModifyMenuItem = true



This is it.
Best regards,
Sergey Kornilov
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic