18 Replies Latest reply on Sep 2, 2016 7:48 AM by john_reynolds

    How Do I Make a Dynamic URL to My Profile?

      I want to put a link to two places on our home page that go to the individual user's content:


      Is there a way to create a dynamic URL that pulls in the username for the person who clicks on that link?


      Any ideas, Mark Weitzel or Ryan Rutan?

        • Re: How Do I Make a Dynamic URL to My Profile?

          I am not aware of any such widget till 6.0. This will need customization.

          In the ftl you can use  ${user.username} to print username of current logged in users.


          So the code in ftl will be like


          <a href="https://myjivesite.com/people/${user.username}/content">My Content</a>

          <a href="https://myjivesite.com/people/${user.username}/places">My Places</a>



          • Re: How Do I Make a Dynamic URL to My Profile?

            Yes, there is a JS object loaded on every page that has the current user info, you could use that plus some simple JS and it would create a link.  If you can follow up with me tomorrow I can give you snippet, remote at the moment.  Thanks ted

            • Re: How Do I Make a Dynamic URL to My Profile?

              All of you guys rock for offering help so fast!




              Munish Chopra, I am not experienced editing FTL files, though I confess I have hacked a few when no other solution sufficed. I'd need a bit more guidance to understand how to make your solution actually appear where I'd want it on the overview page. Thanks, nonetheless, for stepping forward with a solution so rapidly!


              Ryan Rutan, I tested each of your options and, sadly, none worked -- you are correct to assume that the user will be logged in to Jive when they use the links. I don't know why the options you suggested failed, but upon clicking, I ended up still on the Overview page.


              John Schwiller, I want to feature these links prominently, so putting them in QuickLinks (which we do use) is not the optimal solution I am seeking. I did not test yet whether what you generously offered worked, but I thank you for the great idea!

                • Re: How Do I Make a Dynamic URL to My Profile?

                  Ted, Ryan's suggestion should work unless the javascript is getting stripped, if you use chrome, you can right click and inspect the element to see if the javascript gets stripped out. If it does, you could create an HTML Widget and then use what Ryan typed. If it puts it into an iframe use the same URL except put parent. in front of the window text.

                  1 person found this helpful
                    • Re: How Do I Make a Dynamic URL to My Profile?

                      Thanks, Dave! I was trying to use a Formatted Text widget. HTML widget made the links actually do something, instead of just leaving me on the same page.


                      However, Ryan's code failed -- I got Page Not Found errors.


                      However, I figured out how to make it work!


                      Here is the code that works -- Ryan simply omitted part of the URL -- people/ -- and once I put that in, both of Ryan's code samples worked perfectly.


                      Ryan's First Links</br><a href="javascript:void(0);" onclick="window.location.replace('/'+'people/'+window._jive_current_user.username+'/content');">My Content</a></br>

                      <a href="javascript:void(0);" onclick="window.location.replace('/'+'people/'+window._jive_current_user.username+'/places');">My Places</a></br>Ryan's Second Idea</br>

                      <a href="javascript:window.location.replace('/'+'people/'+window._jive_current_user.username+'/places');">My Places</a></br>

                      <a href="javascript:window.location.replace('/'+'people/'+window._jive_current_user.username+'/content');">My Content</a>


                      So, in less than 24 hours I have gone from having no idea how to do this nifty bit of linking to having a solution I can deploy -- thanks, everybody, so much!!!

                      1 person found this helpful
                        • Re: How Do I Make a Dynamic URL to My Profile?

                          Thought I'd share where I have gone with this, so far, now that the secret has been unlocked for me:


                          Note that I worded the last item in a way to entice people to click on it, and hopefully update it, as it takes them to their profile page. And the "Hub Points Rank" will only work if you have the Bunchball Advanced Gamification module installed.


                          The code:

                          <a href="javascript:void(0);" onclick="window.location.replace('/'+'people/'+window._jive_current_user.username+'/content');">Your Content</a></br>

                          <a href="javascript:void(0);" onclick="window.location.replace('/'+'people/'+window._jive_current_user.username+'/places');">Your Places</a></br>

                          <a href="javascript:void(0);" onclick="window.location.replace('/'+'people/'+window._jive_current_user.username+'/activity');">Your Recent Activity</a></br>

                          <a href="javascript:void(0);" onclick="window.location.replace('/'+'people/'+window._jive_current_user.username+'/people');">Your Connections</a></br>

                          <a href="javascript:void(0);" onclick="window.location.replace('/'+'people/'+window._jive_current_user.username+'/bookmarks?sortKey=user~subjectAsc&sortOrder=1');">Your Bookmarks</a></br>

                          <a href="javascript:void(0);" onclick="window.location.replace('/'+'reputation.jspa?username='+window._jive_current_user.username+'&viewID=leaders');">Your Hub Points Rank</a></br>

                          <a href="javascript:void(0);" onclick="window.location.replace('/'+'people/'+window._jive_current_user.username+'/profile');">What People Know About You</a></br>

                            • Re: How Do I Make a Dynamic URL to My Profile?

                              Hi Ted Hopton,


                              This is really a good solution for using this code in HTML widget. But actually, this code is disabling "Open in new window/open in new tab" options on right click in IE browsers. Is there any alternative for this?


                              Currently, I am passing few parameters in <a> tag, and then using javascript functions by calling those parameters. This is working, but there is slight issue with performance. Please let me know if there is any better approach than this.



                      • Re: How Do I Make a Dynamic URL to My Profile?

                        Great idea to get people to figure out "what people know about them" Ted! 


                        Thanks for puzzling through this - and for sharing it!

                        • Re: How Do I Make a Dynamic URL to My Profile?

                          Hi Ted!


                          Thank you for this! We are actually trying to use your a href="javascript:void(0);" onclick="window.location.replace('/'+'people/'+window._jive_current_user.username+'/profile');">What People Know About You</a></br> To link to a button on our main page that would take a user to their profile. However, we've used your code, but all we get is an about:blank tab that opens instead of the profile page. Would you have any insight into this? We are using the HTML widget...



                          • Re: How Do I Make a Dynamic URL to My Profile?

                            I want a url to put in email comms to users https://myinstance.comapny.com/people/me.jsp or the likes, so it dynamically takes me to the profile page for me based on my logged in credentials. How can i achieve this?

                            • Re: How Do I Make a Dynamic URL to My Profile?
                              Donna Skoog

                              I am trying to add a dynamic link to user profile in custom header html. Unfortunately the suggested code does not seem to work. Is this supposed to work in cloud?