#if ($permissionChecker.isOmniadmin())
#dockbar()
#end
This below code will check if logged in user is Admin or Content Editor or Content Admin, then show dockbar, for rest of the user, hide the dock bar.
#if ( $is_signed_in )
#set ($rService = $serviceLocator.findService("com.liferay.portal.service.RoleService"))
#set ($usrRoles = $rService.getUserRoles( $user_id ))
#foreach( $usrRole in $usrRoles )
#if ( $usrRole.getName() == "Administrator" || $usrRole.getName() == "Content-Admin" || $usrRole.getName() == "Content-Editor")
#dockbar()
#end
#end
#end
#if ( $is_signed_in )
#if ( $user.getScreenName() == "superadmin")
#dockbar()
#end
#end
LogOut:
#if ($show_sign_out)
<a title="Sign Out" href="$sign_out_url" style="float:right;">$sign_out_text</a>
#end
#dockbar()
#end
This below code will check if logged in user is Admin or Content Editor or Content Admin, then show dockbar, for rest of the user, hide the dock bar.
#if ( $is_signed_in )
#set ($rService = $serviceLocator.findService("com.liferay.portal.service.RoleService"))
#set ($usrRoles = $rService.getUserRoles( $user_id ))
#foreach( $usrRole in $usrRoles )
#if ( $usrRole.getName() == "Administrator" || $usrRole.getName() == "Content-Admin" || $usrRole.getName() == "Content-Editor")
#dockbar()
#end
#end
#end
#if ( $is_signed_in )
#if ( $user.getScreenName() == "superadmin")
#dockbar()
#end
#end
LogOut:
#if ($show_sign_out)
<a title="Sign Out" href="$sign_out_url" style="float:right;">$sign_out_text</a>
#end
Hello, where would you add this?
ReplyDeleteI second the first comment, where do you add this code?
ReplyDeleteInside the portal_normal.vm file of your theme.
ReplyDeleteThanks...It work fine for me..
DeleteBut my requirement is to display name (who ever logged in) . It should display as "Logged as NAME".
Hi Sujeet you can get the user name by using $user.getFullName() in your portal_normal.vm
Deleteyou can use as below
#set ($user_full_name = $user.getFullName())
and wherever you want to display the name in theme you can display it by simply writing $user_full_name
good one.Sign out shows.but its not working.
ReplyDeleteCould you let me know what exactly issue you are facing because same solution working fine for me.
Deletei just copy the signout code into portal_normal.vm.
Deleteit shows the "sign out".but not link.
other code hides the dockbar for me.so i lost sign out.
Deletebut i need sign out option.help me
Now its working...thanks for your time
Deletegood to know :)
Deletemay i ask you one thing..
DeleteIn social office theme profile picture is included in the my public pages.But i need this in the portal home page.
am trying replace the
a href="$current_user_profile_url"><img src="$current_user_profile_portrait_url" alt="$current_user_name"
But missing $current_user_profile_url error occured.what is the reason?u have any idea?
try following value in image src :
Delete<%= themeDisplay.getPathImage()%>/user_portrait?img_id=<%=id %>
hope this will resolve the issue you are facing.
no vir..it shos only link $current_user_name"
DeleteAny updates?
Deletethank you for this code, works a treat for the OEM DELL open manage network manager. Perfect!
ReplyDelete