ez.no / ezpublish / documentation / incoming / hide shop/setup navigation tab
These documentation pages are no longer maintained. Please visit the new documentation site.
Obsolete: This will only work for versions 2.9-7 or lower, this document will be removed.
Go to the /design/admin/templates directory and load the left_menu.tpl. This template starts with a block
{default menu_enable_content=true() menu_enable_setup=true() menu_enable_shop=true() menu_enable_users=true() }
Of course you can turn off things here by changing the true() into false(), but it is also possible to add a little intelligence to the mixture.
using fetch('user','current_user') you can ask for the info on the current user. fetch('user','current_user').roles.0.id shows the id for the first role a user has. Role 2 is the administrative role in the default setup, so
eq(fetch('user','current_user').roles.0.id,2)
should only be true when the current user has role 2, has an administrative role. While I'm awear this isn't very generalised or foolprove, I think it's a start.
My current setup:
{default menu_enable_content=true() menu_enable_setup=eq(fetch('user','current_user').roles.0.id,2) menu_enable_shop=false() menu_enable_users=true() }
Comments
One way to do it ... as I just did in 3.5
Joel Hardi
Tuesday 04 January 2005 3:05:48 am
First, modify global site access settings in /settings/override/site.ini.append.php. Here's my example to hide the "design" and "webshop" tabs:
[SiteAccessRules]
Rules[]
# Enable all functions
Rules[]=Access;enable
Rules[]=ModuleAll;true
# Disable design and shop
Rules[]=Access;disable
Rules[]=Module;visual
Rules[]=Module;shop
Try clicking on the tabs ... you should get an error saying they've been disabled.
Now just override the pagelayout.tpl template for the admin design to hide the tabs you want. In the default 3.5 admin pagelayout.tpl I changed:
{section var=Menu loop=topmenu($ui_context)}
{include uri='design:page_topmenuitem.tpl' menu_item=$Menu navigationpart_identifier=$navigation_part.identifier}
{/section}
to this:
{section var=Menu loop=topmenu($ui_context)}
{* Here I insert switch statement to skip design and webshop tabs *}
{switch match=$Menu.url}
{case match="shop/orderlist"}{/case}
{case match="visual/menuconfig"}{/case}
{case}
{include uri='design:page_topmenuitem.tpl' menu_item=$Menu navigationpart_identifier=$navigation_part.identifier}
{/case}
{/switch}
{/section}
deleted
Chris Hertz
Tuesday 04 January 2005 3:01:28 am
Don't think so
Jonathan Dillon-Hayes
Saturday 23 October 2004 3:46:59 pm
[webadmin@www1 firebright]$ find . -name "left_menu.tpl" -print
[webadmin@www1 firebright]$
0 results from the dorroot. Does this functionality still exist? If not, this should really be removed.
Re: Hide shop/setup navigation tab
geovanni rosetto
Tuesday 16 September 2003 10:22:37 pm
I can not find the file "left_menu.tpl" in the "design/admin/templates" directory.
How would I set this settings on eZ publish 3.2?
geo