Forum Discussion

darrenSP's avatar
darrenSP
Mentor
7 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.

     

  • 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:

    • darrenSP's avatar
      darrenSP
      Mentor

      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

        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.