Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Can't change member profile path to /members/{userid} View modes: 
User avatar
Member
Member
jhoppe - 4/5/2011 4:08:18 PM
   
Can't change member profile path to /members/{userid}
I have setup the site so that member profiles are available at /members/{userid}.aspx. However, I can't go into Site Manager > Settings > Community > Member profile and change member profile path to /Members/{UserID}. Well, I can, but it doesn't work. :)

I'm guessing that a database query needs to be modified so that it returns UserID. Can someone tell me what query I need to modify?

Thanks!!!
Joe Hoppe

User avatar
Member
Member
kentico_michal - 4/12/2011 2:37:20 AM
   
RE:Can't change member profile path to /members/{userid}
Hi Joe,

Could you please try to change the Document URL path property of the Profile page (Properties -> URLs -> Document URL path) to
/Membes/{UserID}

instead of
/Members/{UserName}?

As a result, you should be able to display user profile using URL as follows: /Members/100.aspx where 100 is the UserID of particular user.

Best regards,
Michal Legen

User avatar
Member
Member
jhoppe - 4/12/2011 10:35:40 AM
   
RE:Can't change member profile path to /members/{userid}
Michal,

The problem with that approach is when I use the search web parts. In the search result transformation, I cannot easily map the result URL to the new member profile URL. The function searchResultURL still returns the link in the format /Members/{UserName}.

I can write a custom function to parse each search result, see if it maps to a user profile URL, and then reformat it. However, that is ugly and I would like to avoid it.

Please let me know if you have any other thoughts.

Thanks


User avatar
Member
Member
kentico_michal - 4/15/2011 8:58:50 AM
   
RE:Can't change member profile path to /members/{userid}
Hello Joe,

Regrettably, you will need to develop a custom transformation method to create a link to user profile in a format which will cover your needs. In general the transformation method could look like following one:


public static string GetCustomUserProfileURL (object userIDObj)
{
string userID = ValidationHelper.GetString(userIDObj, "");
string profileUrl = SettingsKeyProvider.GetStringValue(CMSContext.CurrentSiteName + ".CMSMemberProfilePath");
if (!String.IsNullOrEmpty(profileUrl))
{
return CMS.GlobalHelper.UrlHelper.ResolveUrl(TreePathUtils.GetUrl(profileUrl.ToLower().Replace("{userid}", userID), null));
}
return "";
}


You will need to change the Member profile path in
Site manager -> Settings -> Community -> Member profile path: /Members/{UserID}

To invoke this transformation method you can use following expression:
<%# MyFunctions.GetCustomUserProfileURL (GetSearchValue("UserID")) %>


If you need more information about custom transformation methods, please take a look at following article

Best regards,
Michal Legen