Forum Discussion

zachm's avatar
zachm
Mentor
12 years ago

switch user custom component

We recently modified our community and I lost my switch user component.  I am the community manager but our board is dictated by what our design team created.  I no longer have access to the switch user feature so I thought it would be cool to add this feature to a custom component.  I have the freemarker code to make this only visable to people in specific roles so normal users wouldn't see it.  What I need to know is A) is there a way to see the default lithium component freemarker code so I can duplicate it, or B) does anybody have the freemarker code to add this to a component? 

myprofile.PNG

Essentially, my goal is to add the 'Switch User' button above the 'Go to My Profile' button.  Any additional thoughts or concerns would also be appreciated.  Thanks!

  • You should be able to do this by creating an HTML link (HREF):

     

    The link to the Switch User Page is

    /t5/authentication/switchuserpage

     

    Additionally, if you would like it to reroute you to a destination URL once you have switched your user, you can add a query parameter "dest_url"

    /t5/authentication/switchuserpage?dest_url=http%3A%2F%2Flithosphere.lithium.com%2F

     

    Hope that helps!

2 Replies

  • VenkS's avatar
    VenkS
    Lithium Alumni (Retired)
    12 years ago

    You should be able to do this by creating an HTML link (HREF):

     

    The link to the Switch User Page is

    /t5/authentication/switchuserpage

     

    Additionally, if you would like it to reroute you to a destination URL once you have switched your user, you can add a query parameter "dest_url"

    /t5/authentication/switchuserpage?dest_url=http%3A%2F%2Flithosphere.lithium.com%2F

     

    Hope that helps!

  • zachm's avatar
    zachm
    Mentor
    12 years ago

    Thanks, I guess I was making it harder on myself than I had to!  THis will be perfect.