Foros de discusión

How to hide the dockbar?

Rupesh Chotai, modificado hace 13 años.

How to hide the dockbar?

Regular Member Mensajes: 163 Fecha de incorporación: 23/03/11 Mensajes recientes
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, modificado hace 13 años.

RE: How to hide the dockbar?

Liferay Legend Mensajes: 1302 Fecha de incorporación: 24/06/09 Mensajes recientes
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, modificado hace 12 años.

RE: How to hide the dockbar?

New Member Mensajes: 5 Fecha de incorporación: 22/03/12 Mensajes recientes
hey all !!

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

Thanks
thumbnail
Ravi Kumar Gupta, modificado hace 12 años.

RE: How to hide the dockbar?

Liferay Legend Mensajes: 1302 Fecha de incorporación: 24/06/09 Mensajes recientes
Ankit,

Did you try this
#if ($permissionChecker.isOmniadmin())
#dockbar()
#end
ankit sharma, modificado hace 12 años.

RE: How to hide the dockbar?

New Member Mensajes: 5 Fecha de incorporación: 22/03/12 Mensajes recientes
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, modificado hace 12 años.

RE: How to hide the dockbar?

Liferay Legend Mensajes: 1302 Fecha de incorporación: 24/06/09 Mensajes recientes
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, modificado hace 12 años.

RE: How to hide the dockbar?

New Member Mensajes: 5 Fecha de incorporación: 22/03/12 Mensajes recientes
I am using Liferay 6.1
Is it not possible to hide the dockbar without developing Hooks ?
thumbnail
Ravi Kumar Gupta, modificado hace 12 años.

RE: How to hide the dockbar?

Liferay Legend Mensajes: 1302 Fecha de incorporación: 24/06/09 Mensajes recientes
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, modificado hace 12 años.

RE: How to hide the dockbar?

New Member Mensajes: 5 Fecha de incorporación: 22/03/12 Mensajes recientes
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, modificado hace 12 años.

RE: How to hide the dockbar?

Liferay Legend Mensajes: 1302 Fecha de incorporación: 24/06/09 Mensajes recientes
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, modificado hace 8 años.

RE: How to hide the dockbar?

New Member Mensajes: 4 Fecha de incorporación: 27/11/15 Mensajes recientes
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, modificado hace 13 años.

RE: How to hide the dockbar?

Expert Mensajes: 435 Fecha de incorporación: 9/02/09 Mensajes recientes
Hi,

You can add following condition:


#if ($permissionChecker.isOmniadmin())
#dockbar()
#end
Rupesh Chotai, modificado hace 13 años.

RE: How to hide the dockbar?

Regular Member Mensajes: 163 Fecha de incorporación: 23/03/11 Mensajes recientes
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, modificado hace 13 años.

RE: How to hide the dockbar?

Expert Mensajes: 435 Fecha de incorporación: 9/02/09 Mensajes recientes
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, modificado hace 13 años.

RE: How to hide the dockbar?

Regular Member Mensajes: 163 Fecha de incorporación: 23/03/11 Mensajes recientes
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, modificado hace 13 años.

RE: How to hide the dockbar? (Respuesta)

Regular Member Mensajes: 163 Fecha de incorporación: 23/03/11 Mensajes recientes
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, modificado hace 13 años.

RE: How to hide the dockbar?

New Member Mensajes: 9 Fecha de incorporación: 31/03/11 Mensajes recientes
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, modificado hace 13 años.

RE: How to hide the dockbar?

Regular Member Mensajes: 163 Fecha de incorporación: 23/03/11 Mensajes recientes
Hi Leen,
You can update the user profile and add photo/picture there to appear in the dock bar.