Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Leigh 4 posts 24 karma points
    Feb 19, 2014 @ 16:40
    Leigh
    0

    Creating a public member profile page.

    Hi,

    I would like to create a public profile page for my members, with the url like

    www.mysite.com/my-members/john-doe

    I am using umbraco 6.1.2 not with MVC.

    I started to create documents on the member 'new' and 'afterSave' events using a custom class inheriting from 'ApplicationBase' and then linking them by creating a relationship between the member and the document using the umbraco relation API.

    It seemed like there should be an easier way, and without all the members having to have a document.

    I found a few other examples that use one template page, and use redirects to get the url to look correct.

    http://creativewebspecialist.co.uk/2013/12/03/using-umbraco-pipeline-for-member-profile-urls/
    http://our.umbraco.org/forum/developers/razor/38835-Member-Profile-Pages

    So anyone who goes to

    www.mysite.com/my-members/(any member name)

    will be redirected to

    www.mysite.com/my-members/profile?name=(any member name)

    where I can then get the member using a macro and fill out the page with their information.

    Could someone please tell me how to approach this. Is there a simple way to achieve this goal?

    Thanks in advance.

  • Mike 23 posts 86 karma points
    Feb 19, 2014 @ 18:44
    Mike
    0

    I may be wrong, but it sounds like you're pretty much there! All you'll need to do is to get the member from the username in the URL, which should be as simple as using Membership.GetUser(username). If this returns null, either redirect or show an error, and if it returns a member get the required properties to show their info.

    You might want to add some more sophisticated checks in there, such as limiting it to certain types of members, or only allowing logged-in users to view profile pages, but from what I can tell that should do it.

Please Sign in or register to post replies

Write your reply to:

Draft