Showing Links of Restricted Pages

Author Message

John Smith

Friday 31 July 2009 1:48:07 am

Hi Guys,

Hope get some help from here. I am building a site with two level menu. The first level of menu for a site is always accessible to the all the users. But the second level menu is only acccessible when the members are logged in.... The problem is, I also want to show the links for the second level for the anomoyous users.

Is there any best way to achieve this? Hopefully will not be disappointed.

Cheers,

Ivo Lukac

Friday 31 July 2009 2:20:03 am

You need to find the fetch function for second level (in top menu template) and add parameter which will disable policy checking:

limitation,array(),

check http://ez.no/doc/ez_publish/technical_manual/4_0/reference/modules/content/fetch_functions/list for more details

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Marcel Marnet

Moderated by: Marcel Marnet

Friday 31 July 2009 2:59:50 am

'limitation', array( hash( 'Section', array( SECTION_IDS ) ))

the array includes the section-ids, which the user should get access for.

example for fetching news and articles on an ez system with more than 1 section:

{def $newslist=fetch('content','tree',
                       hash('parent_node_id',2,
                            'sort_by',array('published',false()),
                            'class_filter_type',  'include',
                            'class_filter_array', array('news','article'),
                            'limit',5,
                            'limitation', array( hash( 'Section', array( 1, 3, 6, 7, 8 ) )
                                               ) 
                            )
                     )
}

cubby cub

Tuesday 25 August 2009 6:07:31 am

hello,

what you're saying is you need to modify the original code correct? meaning that, this isn't a site/template specific issue. all users of this script who desire to show links of restricted pages will need to do the exact same thing. correct?

if that's the case, why not take an extra moment or two to add the code changes here in the forum? why not use the code tag to do the following...

1. the following works for ez_pub version a.b.c. look for public_html/ez_pub/in-some-directory/x.ext (the full path of the file).

2. find the following on/around line x

some original code 

3. change to

modified code that fixes the issue

-------

is this too much to ask?

i mean, apparently you all know how to fix this so if you know how to fix it, why don't you just post the solution rather than having people who may not be as savvy as you searching around.

i know what you're asking me to do and i'm sure that with a bit of hunting around i can find the file and add the fix. the thing is, if you already know what file i need to edit, why don't you share? is it a secret?

i just decided to hard code my top menu. it's not worth it to me to take the time AT THIS POINT to figure out which file contains functions

Aang: Just like the legend says, we let love lead the way.

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 31 2025 00:23:40
Script start
Timing: Jan 31 2025 00:23:40
Module start 'layout'
Timing: Jan 31 2025 00:23:40
Module start 'content'
Timing: Jan 31 2025 00:23:40
Module end 'content'
Timing: Jan 31 2025 00:23:40
Script end

Main resources:

Total runtime0.0211 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0050 588.1563151.2109
Module start 'layout' 0.00500.0030 739.3672220.6875
Module start 'content' 0.00800.0120 960.05471,001.8359
Module end 'content' 0.02000.0011 1,961.890633.9922
Script end 0.0211  1,995.8828 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002210.3618140.0002
Check MTime0.00094.3091140.0001
Mysql Total
Database connection0.00083.613310.0008
Mysqli_queries0.002310.812930.0008
Looping result0.00000.042910.0000
Template Total0.00083.810.0008
Template load0.00062.951310.0006
Template processing0.00020.817610.0002
Override
Cache load0.00041.938610.0004
General
dbfile0.00125.452780.0001
String conversion0.00000.032740.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