掲示板

How to hide the dockbar?

13年前 に Rupesh Chotai によって更新されました。

How to hide the dockbar?

Regular Member 投稿: 163 参加年月日: 11/03/23 最新の投稿
Hi All,
I have requirement to show dockbar only for the Admin user role and not for the guest.
How can this be configured in liferay?

Thanks in advance for the reply.
thumbnail
13年前 に Ravi Kumar Gupta によって更新されました。

RE: How to hide the dockbar?

Liferay Legend 投稿: 1302 参加年月日: 09/06/24 最新の投稿
See this post

You might need to modify portal_normal.vm in theme for
#if($is_signed_in)
	#dockbar()
#end


-Ravi -aka- D'Maverick
12年前 に ankit sharma によって更新されました。

RE: How to hide the dockbar?

New Member 投稿: 5 参加年月日: 12/03/22 最新の投稿
hey all !!

How can dockbar be hidden for all users except the administrator?

Thanks
thumbnail
12年前 に Ravi Kumar Gupta によって更新されました。

RE: How to hide the dockbar?

Liferay Legend 投稿: 1302 参加年月日: 09/06/24 最新の投稿
Ankit,

Did you try this
#if ($permissionChecker.isOmniadmin())
#dockbar()
#end
12年前 に ankit sharma によって更新されました。

RE: How to hide the dockbar?

New Member 投稿: 5 参加年月日: 12/03/22 最新の投稿
Ravi,

Ya it works have tried that, i had one more question i.e how can be few option removed from the dockbar of user for eg, removing option of going to control panel, adding pages and portlets etc ?

Thanks,
Ankit
thumbnail
12年前 に Ravi Kumar Gupta によって更新されました。

RE: How to hide the dockbar?

Liferay Legend 投稿: 1302 参加年月日: 09/06/24 最新の投稿
Which version you are using.. ? for 6.0.x versions you should change the jsps in /webapps/ROOT/html/dockbar/. Remember to create a jsp hook instead of directly modifying the jsps.

HTH
12年前 に ankit sharma によって更新されました。

RE: How to hide the dockbar?

New Member 投稿: 5 参加年月日: 12/03/22 最新の投稿
I am using Liferay 6.1
Is it not possible to hide the dockbar without developing Hooks ?
thumbnail
12年前 に Ravi Kumar Gupta によって更新されました。

RE: How to hide the dockbar?

Liferay Legend 投稿: 1302 参加年月日: 09/06/24 最新の投稿
Yes, it is possible. But anything you modify in liferay which already exists, the recommended way is to use hooks/ext. If you want to hide some part of dockbar then you need to modify jsps. Otherwise, if you want to hide the dock completely, then you can just create a new theme and apply your logic in portal_normal.vm file of the template in theme.

HTH
12年前 に ankit sharma によって更新されました。

RE: How to hide the dockbar?

New Member 投稿: 5 参加年月日: 12/03/22 最新の投稿
k, but if the dockbar is hidden then a particular user wont be able to go to his private and public pages.
Is there any alternate way to give user option to go to his private/ public pages?
thumbnail
12年前 に Ravi Kumar Gupta によって更新されました。

RE: How to hide the dockbar?

Liferay Legend 投稿: 1302 参加年月日: 09/06/24 最新の投稿
You can put the code which generates url for public and private pages; at the place where you need.
Thing is, its not that if dockbar is not there so there won't be any pages. Pages are there and dockbar is just holding the links to those pages.
8年前 に Chris Moberly によって更新されました。

RE: How to hide the dockbar?

New Member 投稿: 4 参加年月日: 15/11/27 最新の投稿
This thread was extremely helpful!

In case anyone stumbles on this, I put the suggestions above in a combined format. This ensures only admins see the dockbar, and non-admins will see a log out option but only when they are logged in.

I placed this in the 'portal_normal.vm' file in my these, making sure to write it around the existing code for #dockbar:

#if($is_signed_in)
#if ($permissionChecker.isOmniadmin())
#dockbar()
#else
<div align="right"><a title="Sign Out" href="$sign_out_url"><b>Sign Out...</b></a></div>
#end
#end
thumbnail
13年前 に Dhrutika Parekh によって更新されました。

RE: How to hide the dockbar?

Expert 投稿: 435 参加年月日: 09/02/09 最新の投稿
Hi,

You can add following condition:


#if ($permissionChecker.isOmniadmin())
#dockbar()
#end
13年前 に Rupesh Chotai によって更新されました。

RE: How to hide the dockbar?

Regular Member 投稿: 163 参加年月日: 11/03/23 最新の投稿
Hi Dhrutika,
Thanks for the reply. It works when I updated the portal_normal.vm (html\themes\classic\templates) under ROOT.war

However, it hides the 'Sign-In' link as well from the upper right corner, which is not acceptable. Can you suggest what is required to just hide the Dock bar for all non-admin users and show Sign-in link.

Thanks in advance.
thumbnail
13年前 に Dhrutika Parekh によって更新されました。

RE: How to hide the dockbar?

Expert 投稿: 435 参加年月日: 09/02/09 最新の投稿
Hi Rupesh,

If you are using Liferay 6 classic theme,login link should not be hidden.

Then also verify your portal_normal.vm.It should have following line in code.

#if(!$is_signed_in)
<a href="$sign_in_url" id="sign-in" rel="nofollow">$sign_in_text</a>
#end

One point that you should not extend classic theme by changing in ROOT.war.You should create new theme as replication of classic theme and apply your changes.

Regards,
Dhrutika Parekh
13年前 に Rupesh Chotai によって更新されました。

RE: How to hide the dockbar?

Regular Member 投稿: 163 参加年月日: 11/03/23 最新の投稿
Hi Dhrutika,
Thank you for the reply.
I am created new theme which is replica of Classic theme. And the code you have mentioned is also present. May be I have mentioned 'Sign-in' in previous post so it might have create some confusion.
To elaborate more on the issue, please see below scenario:
1. Login as Admin -> Dock bar displayed -> Logout option is available.
2. Login as non-admin -> Dock bar hidden -> Logout option is NOT available.

I am looking for logout option for ALL users.
Can you advise in this regards?

Thanks in advance.
13年前 に Rupesh Chotai によって更新されました。

RE: How to hide the dockbar? (回答)

Regular Member 投稿: 163 参加年月日: 11/03/23 最新の投稿
Hi All,
I find the answer:
Put the below line of code in portal_normal.vm in your theme


#if ($show_sign_out && !$permissionChecker.isOmniadmin())
<a title="Sign Out" href="$sign_out_url">CDS $sign_out_text</a>
#end


Thank you all for the replies.
13年前 に leen salam によって更新されました。

RE: How to hide the dockbar?

New Member 投稿: 9 参加年月日: 11/03/31 最新の投稿
hello,

I was facing the the same problem of you.when I read your post the code you post work successfully with me and solved my problem,
BUT ,if i want the picture of the user and his name to appear beside the "sign out"
can you help me in that please??
sorry ,iam not v.good in english

thanks in advance
13年前 に Rupesh Chotai によって更新されました。

RE: How to hide the dockbar?

Regular Member 投稿: 163 参加年月日: 11/03/23 最新の投稿
Hi Leen,
You can update the user profile and add photo/picture there to appear in the dock bar.