Forums / Setup & design / Showing Links of Restricted Pages

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.

eZ debug

Timing: Jan 18 2025 10:32:56
Script start
Timing: Jan 18 2025 10:32:56
Module start 'content'
Timing: Jan 18 2025 10:32:56
Module end 'content'
Timing: Jan 18 2025 10:32:56
Script end

Main resources:

Total runtime0.6587 sec
Peak memory usage4,096.0000 KB
Database Queries67

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 589.1797180.8281
Module start 'content' 0.00600.6472 770.0078634.5234
Module end 'content' 0.65320.0054 1,404.531346.1016
Script end 0.6586  1,450.6328 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.4621140.0002
Check MTime0.00120.1849140.0001
Mysql Total
Database connection0.00070.112710.0007
Mysqli_queries0.609892.5894670.0091
Looping result0.00060.0926650.0000
Template Total0.634596.320.3172
Template load0.00210.312420.0010
Template processing0.632496.009020.3162
Template load and register function0.00020.033410.0002
states
state_id_array0.00050.068910.0005
state_identifier_array0.00070.106120.0003
Override
Cache load0.00180.2671320.0001
Sytem overhead
Fetch class attribute can translate value0.00050.081840.0001
Fetch class attribute name0.00110.160760.0002
XML
Image XML parsing0.00130.190740.0003
class_abstraction
Instantiating content class attribute0.00000.002060.0000
General
dbfile0.00390.5944250.0002
String conversion0.00000.000730.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 20
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs