Menu link only for administrators

Author Message

Danilo Shiga

Thursday 21 February 2008 10:33:46 am

i wanted to put a link in the flat top menu that would be only visible for administrator users, but I'm having troubles with the better way to do it and how the current user should be filtered.

thanks for any help.

Mark Marsiglio

Thursday 21 February 2008 10:41:40 am

The best way to do this is to use permissions.

Create a new section (admin > setup > section) and assign it to your new content. I think that this, in itself, should be enough to meet your requirements.

You can get a lot more complex with it, but if you create a new section and don't explicitly give the anonymous role permission to see it, admins will be able to see it when they are logged in.

To be safe, you can also create a new role which has access to content/read/yournewsection and apply that (along with the anonymous) role to new a user group. Then add users to that new group and they will be able to see it. Do this if the people who you want to see the new hidden folder really are not admins.

http://www.thinkcreative.com
Turning Ideas Into Strategic Solutions

Danilo Shiga

Thursday 21 February 2008 11:10:48 am

thanks, this solve my problem, i was trying to do this inserting code in the flat_top, but your solution looks better.

Mark Marsiglio

Thursday 21 February 2008 11:14:09 am

The way you were trying to do it would be appropriate if you wanted content to be visible on the site, but not as a direct link from the navigation. You could exclude a particular node from flat_top.tpl to make that happen. But the content would still be visible in search and by direct link.

http://www.thinkcreative.com
Turning Ideas Into Strategic Solutions

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 19:24:37
Script start
Timing: Jan 18 2025 19:24:37
Module start 'layout'
Timing: Jan 18 2025 19:24:37
Module start 'content'
Timing: Jan 18 2025 19:24:37
Module end 'content'
Timing: Jan 18 2025 19:24:37
Script end

Main resources:

Total runtime0.0170 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 587.9141152.6250
Module start 'layout' 0.00600.0027 740.539139.4453
Module start 'content' 0.00870.0062 779.984489.2109
Module end 'content' 0.01490.0021 869.195334.3047
Script end 0.0170  903.5000 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002615.3710140.0002
Check MTime0.00126.8538140.0001
Mysql Total
Database connection0.00095.431310.0009
Mysqli_queries0.002414.066130.0008
Looping result0.00000.082610.0000
Template Total0.001710.110.0017
Template load0.00095.467710.0009
Template processing0.00084.579910.0008
Override
Cache load0.00073.822510.0007
General
dbfile0.00148.209280.0002
String conversion0.00000.046240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs