Forum Discussion

darrenSP's avatar
darrenSP
Mentor
8 years ago

URL for My Profile without user.id

Hi,

 

Is there a URL that I can use outside of lithium that will take the user to their profile?

 

I currently cannot get access to the user.id offsite so I need a generic link to take the user to their profile, without this ID.

Usually it would be https://community.domain.com/t5/user/viewprofilepage/user-id/{{USERID}}

 

Thanks, Darren.

  • darrenSP- If your community is non-responsive, then http://community-url/t5/user/viewprofilepage/user-login/<user-login> this URL can be alternative way to open user profile.

     

    We only can open user profile with two way, either user id or user login.

     

8 Replies

  • darrenSP's avatar
    darrenSP
    Mentor
    8 years ago

    We do, but to pass in any user login data to the URL string would require a change we can't make just now. So if we do not have a static link to view My Profile, it can't be done just now. 

     

    We know the issue, but we can't do the fix at present.

  • TariqHussain's avatar
    TariqHussain
    Boss
    8 years ago

    darrenSP- If your community is non-responsive, then http://community-url/t5/user/viewprofilepage/user-login/<user-login> this URL can be alternative way to open user profile.

     

    We only can open user profile with two way, either user id or user login.

     

  • darrenSP's avatar
    darrenSP
    Mentor
    8 years ago

    Thanks, not the answer I was hoping for as it seems silly not to have a generic my profile link.

     

    Cheers for the help!

  • luk's avatar
    luk
    Boss
    8 years ago

    What will happen on a responsive community then?

  • darrenSP's avatar
    darrenSP
    Mentor
    8 years ago

    This works with responsive community

    https://community.business.com/t5/user/viewprofilepage/user-id/{user.id}
  • CarolineS's avatar
    CarolineS
    Boss
    7 years ago

    I agree that this is not a very satisfactory solution! I'm trying to send an email to a bunch of community members in which I instruct them to go to their profile; it would be so nice if I could just link to the profile instead of saying "Go to your Community profile" without a link. I'm sending this email via Marketo, to which I haven't imported community user IDs, just email addresses. I guess I could start importing community user ID to Marketo, but I don't really want to / marketing might get grumpy about new fields.

     

    Cheers!

  • I had this same need and I think I solved it with a custom endpoint. The endpoint creates a static URL that forwards logged in users to their profile page and redirects anonymous users through the login page.

    Try this:

    <#if !user.anonymous>
    <script>
      window.location.replace("${user.webUi.url}");
    </script>
    <#else>
    <script>
      window.location.replace("${webUi.getUserLoginPageUrl("${http.request.url}")}");
    </script>
    </#if>

     

    References: