Fórum

Hide Product Menu for Users

thumbnail
Marco Endres, modificado 7 Anos atrás.

Hide Product Menu for Users

Regular Member Postagens: 112 Data de Entrada: 22/08/12 Postagens Recentes
Hey guys,

Is ther an easy way to hide the Product Menu for normal users? It would be also okay, if the other menus are hidden, too.

Thank you

Marco

thumbnail
Jamie Sammons, modificado 7 Anos atrás.

RE: Hide Product Menu for Users (Resposta)

Expert Postagens: 301 Data de Entrada: 05/09/14 Postagens Recentes
Hi Marco,

I believe the easiest way is through a custom theme. See the attached test theme that I have created that hides the Product Menu/Control Menu for Users.

-Jamie
thumbnail
Marco Endres, modificado 7 Anos atrás.

RE: Hide Product Menu for Users

Regular Member Postagens: 112 Data de Entrada: 22/08/12 Postagens Recentes
Hello Jamie

That's the solution i needed. Thank you very much for the fast answer. It works fine emoticon

I changed your css a little bit because i need the margin-top: 0; always and not only when the dockbar is open.

Marco Endres
NITEEN KUMAR, modificado 7 Anos atrás.

RE: Hide Product Menu for Users

New Member Mensagem: 1 Data de Entrada: 20/09/13 Postagens Recentes
Thanks for the suggestions. I'm a new bie..Can you please let me know how I can import this zip theme file to my liferay 7 instance?
thumbnail
Marco Endres, modificado 7 Anos atrás.

RE: Hide Product Menu for Users

Regular Member Postagens: 112 Data de Entrada: 22/08/12 Postagens Recentes
I only checked the difference to my theme and i didn't run the theme.
scott E mitchell, modificado 7 Anos atrás.

RE: Hide Product Menu for Users

Junior Member Postagens: 41 Data de Entrada: 01/10/16 Postagens Recentes
I go through the conversation is it working for liferay7 if i wont to disable my left pane after normal user login and make it available on admin login i s there any clear approach for that so please let me know.
thumbnail
Marco Endres, modificado 6 Anos atrás.

RE: Hide Product Menu for Users

Regular Member Postagens: 112 Data de Entrada: 22/08/12 Postagens Recentes
Hello Scott

Yeah you can disable the productmenu only when it's not a admin. You can check it via Freemarker with .isOmniAdmin. You should also check for siteadmins.

Greetings

Marco Endres
scott E mitchell, modificado 6 Anos atrás.

RE: Hide Product Menu for Users

Junior Member Postagens: 41 Data de Entrada: 01/10/16 Postagens Recentes
Hey thanks Marco for reply ,as you suggest "Yeah you can disable the productmenu only when it's not a admin. You can check it via Freemarker with .isOmniAdmin. You should also check for siteadmins." so its possible with liferay7 and if you precisely explain little more explanation so it would be great help for me so please reply with more explanatory way or how to get all this ....TIA
thumbnail
Marco Endres, modificado 6 Anos atrás.

RE: Hide Product Menu for Users

Regular Member Postagens: 112 Data de Entrada: 22/08/12 Postagens Recentes
Here:

In the init.ftl
<#assign permission_checker = themeDisplay.getPermissionChecker() />

<#assign is_group_admin = permission_checker.isGroupAdmin(group_id) />
<#assign is_omniadmin = permission_checker.isOmniadmin() />

<#assign show_dockbar = is_group_admin || is_omniadmin />

<#if show_dockbar>
    <#assign wrapper_class_name = "" />
<#else>
    <#assign wrapper_class_name = "hide-dockbar" />
<!--#if-->


In the portal-normal.ftl
	&lt;#if show_dockbar&gt;

		&lt;@liferay_ui["quick-access"] contentId="#main-content" /&gt;

		&lt;@liferay_util["include"] page=body_top_include /&gt;

		&lt;@liferay.control_menu /&gt;

	<!--#if-->
scott E mitchell, modificado 6 Anos atrás.

RE: Hide Product Menu for Users

Junior Member Postagens: 41 Data de Entrada: 01/10/16 Postagens Recentes
Thanks Marco that's really help full I check with LF7-GA3 ,and I have one more issue like how to inherit/extend the classic theme if possible so please reply actually by default there is no code for theme for modification so i try to create a new theme and want the theme is same as that of the classic theme so please provide some guide lines under this.


thanks you so much.
thumbnail
Marco Endres, modificado 6 Anos atrás.

RE: Hide Product Menu for Users

Regular Member Postagens: 112 Data de Entrada: 22/08/12 Postagens Recentes
Bradley McIlwain, modificado 6 Anos atrás.

RE: Hide Product Menu for Users

New Member Postagens: 10 Data de Entrada: 15/03/17 Postagens Recentes
Marco Endres:
Here:

In the init.ftl
&lt;#assign permission_checker = themeDisplay.getPermissionChecker() /&gt;

&lt;#assign is_group_admin = permission_checker.isGroupAdmin(group_id) /&gt;
&lt;#assign is_omniadmin = permission_checker.isOmniadmin() /&gt;

&lt;#assign show_dockbar = is_group_admin || is_omniadmin /&gt;

&lt;#if show_dockbar&gt;
    &lt;#assign wrapper_class_name = "" /&gt;
&lt;#else&gt;
    &lt;#assign wrapper_class_name = "hide-dockbar" /&gt;
<!--#if-->


In the portal-normal.ftl
	&lt;#if show_dockbar&gt;

		&lt;@liferay_ui["quick-access"] contentId="#main-content" /&gt;

		&lt;@liferay_util["include"] page=body_top_include /&gt;

		&lt;@liferay.control_menu /&gt;

	<!--#if-->


Hi Marco, I am wanting to make these changes as well but cannot locate these files. Can you provide some direction on where these files rest so that I can update them as you suggest? Thanks!
thumbnail
Marco Endres, modificado 6 Anos atrás.

RE: Hide Product Menu for Users

Regular Member Postagens: 112 Data de Entrada: 22/08/12 Postagens Recentes
Hello Bradley

The init.ftl and portal_normal.ftl are generated files and you can override them when you place your own with the same folderstructure. To be totally correct you should place the variables inside of the init_custom.ftl, because you shouldn't touch the init.ftl because it changes sometimes and if you write it by yourself the changes from Liferay come not through. Check the build folder for more informations what gets generated.

Greetings

Marco Endres
thumbnail
sanju ., modificado 4 Anos atrás.

RE: Hide Product Menu for Users

New Member Postagens: 3 Data de Entrada: 16/07/10 Postagens Recentes
Can we hide dockbar for REGULAR ROLES and custom SITE ROLES users? in freemarker theme

​​​​​​​
Thanks,
Sanjay
Jason Chee, modificado 4 Anos atrás.

RE: Hide Product Menu for Users

Junior Member Postagens: 52 Data de Entrada: 24/09/18 Postagens Recentes
Just an idea for those who wish to hide the product menu. I recently use CSS position property to reposition the product menu so that it looks like it's part of my site's header (as opposed to an extra header that takes up vertical space, as it is by default). This way, when the admins log in, they see the product menu icons  as part of their website's header, while the product menu icons simply disappear when normal users log in.
L Winchester, modificado 4 Anos atrás.

RE: Hide Product Menu for Users

Junior Member Postagens: 50 Data de Entrada: 21/09/16 Postagens Recentes
Jason - very interesting! The product menu is so extensive, I'm trying to imagine how it would work as part of a horizontal header menu... Would you be able to show screenshots, or even better, provide your CSS code so we can test it ourselves? 
Jason Chee, modificado 4 Anos atrás.

RE: Hide Product Menu for Users

Junior Member Postagens: 52 Data de Entrada: 24/09/18 Postagens Recentes

This is roughly how I do it, but it's really up to you to experiment with the theme's css to achieve what you want.