留言板

How to hide the dockbar?

Rupesh Chotai,修改在13 年前。

How to hide the dockbar?

Regular Member 帖子: 163 加入日期: 11-3-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
Ravi Kumar Gupta,修改在13 年前。

RE: How to hide the dockbar?

Liferay Legend 帖子: 1302 加入日期: 09-6-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
ankit sharma,修改在12 年前。

RE: How to hide the dockbar?

New Member 帖子: 5 加入日期: 12-3-22 最近的帖子
hey all !!

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

Thanks
thumbnail
Ravi Kumar Gupta,修改在12 年前。

RE: How to hide the dockbar?

Liferay Legend 帖子: 1302 加入日期: 09-6-24 最近的帖子
Ankit,

Did you try this
#if ($permissionChecker.isOmniadmin())
#dockbar()
#end
ankit sharma,修改在12 年前。

RE: How to hide the dockbar?

New Member 帖子: 5 加入日期: 12-3-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
Ravi Kumar Gupta,修改在12 年前。

RE: How to hide the dockbar?

Liferay Legend 帖子: 1302 加入日期: 09-6-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
ankit sharma,修改在12 年前。

RE: How to hide the dockbar?

New Member 帖子: 5 加入日期: 12-3-22 最近的帖子
I am using Liferay 6.1
Is it not possible to hide the dockbar without developing Hooks ?
thumbnail
Ravi Kumar Gupta,修改在12 年前。

RE: How to hide the dockbar?

Liferay Legend 帖子: 1302 加入日期: 09-6-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
ankit sharma,修改在12 年前。

RE: How to hide the dockbar?

New Member 帖子: 5 加入日期: 12-3-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
Ravi Kumar Gupta,修改在12 年前。

RE: How to hide the dockbar?

Liferay Legend 帖子: 1302 加入日期: 09-6-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.
Chris Moberly,修改在8 年前。

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
Dhrutika Parekh,修改在13 年前。

RE: How to hide the dockbar?

Expert 帖子: 435 加入日期: 09-2-9 最近的帖子
Hi,

You can add following condition:


#if ($permissionChecker.isOmniadmin())
#dockbar()
#end
Rupesh Chotai,修改在13 年前。

RE: How to hide the dockbar?

Regular Member 帖子: 163 加入日期: 11-3-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
Dhrutika Parekh,修改在13 年前。

RE: How to hide the dockbar?

Expert 帖子: 435 加入日期: 09-2-9 最近的帖子
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
Rupesh Chotai,修改在13 年前。

RE: How to hide the dockbar?

Regular Member 帖子: 163 加入日期: 11-3-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.
Rupesh Chotai,修改在13 年前。

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

Regular Member 帖子: 163 加入日期: 11-3-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.
leen salam,修改在13 年前。

RE: How to hide the dockbar?

New Member 帖子: 9 加入日期: 11-3-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
Rupesh Chotai,修改在13 年前。

RE: How to hide the dockbar?

Regular Member 帖子: 163 加入日期: 11-3-23 最近的帖子
Hi Leen,
You can update the user profile and add photo/picture there to appear in the dock bar.