menu_folder

Author Message

Endre Solem

Thursday 10 June 2004 1:50:55 am

Hello all.

I'm pretty new to ezpublish so if this sounds crazy please let me know in a nice way.

Is is possible to make a new folder class for menu items? I'm thinking of more or less copying the exsisting folder class and renaming it menu_folder or something like that.
Then all the listings in EZpublsih won't take this folder into their lists and I can write my menu templates to look for a menu_folder.

Does this sound like something that could be a smart ting to do or not? The reason for this is that I want some menu items to alyaws stay in the top menu and some always in my left menu + a dynamic left menu for that particular page.

Endre

Trond Åge Kvalø

Thursday 10 June 2004 3:37:42 am

Hi Endre.

If I haven't mistaken you entirely, what you're saying is that you only want certain folders to be shown in the top menu and then some others should only be shown in the left menu, and then some folders should be shown in the left menu depending on which choice you've made in those menus, right?

You can do it the way you described and there are other ways to do it as well. You could for instance use some filtering techniques in your fetch statements in your templates to exclude those folders you want.

Have a look at:

http://ez.no/ez_publish/documentation/reference/data_fetching/content/list

to learn more about Data Fetching and filtering

hope this helps
trondåge

trondåge

Kevin polston

Wednesday 13 October 2004 3:11:48 am

I had a similar problem and wanted to manually assign top and left folders to menu selections

The EzPublish menu selection mechanism does an excellent job of setting-up left and right menu navigation. But I wanted to explicitly control the folders that were on the top and left menus.

Here is my method please let me know of better techniques I'm an EzPublish beginner!

Step1) Firstly we must mark the folder class with an additional attribute. I chose to use left, right; or not applicable and called the attribute menu_position;. Do this by adding a selection attribute to the folder class in the administration menu.

Step 2) Now, we must change the code to select and populate our topmenu. Copy the base flat_top.tpl template into your design/<your-site>/templates/menu directory and add the attribute filter as shown below to the fetch logic (the 1 corresponds to top, 2 to left and 0 to not applicable)

       menuitems=fetch( content, list, hash( parent_node_id, 2,
                                               class_filter_type, include,
                                               class_filter_array, ezini( 'MenuContentSettings', 'LeftIdentifierList', 'menu.ini' ),
                                               attribute_filter, array(array('folder/menu_position','=',1)),
                                               sort_by, $root_node.sort_array ) )}

Step 3) Now we must code the left menu. I chose to copy the top_menu.tpl code and renamed it to my_left.tpl. I then altered the first three lines to:

<div id="leftmenu">
<div id="leftmenu-design">
 <h3 class="hide">{"Left menu"|i18n("design/base")}</h3>

Step 4) Now make sure that you alter the siteaccess/<your site>/menu.ini.append.php file to ensure the correct menu scheme is being used - for instance:

[SelectedMenu]
CurrentMenu=LeftTop
TopMenu=flat_top
LeftMenu=my_left

Hope this helps.

Cheers
Kevin

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 19 2025 00:09:32
Script start
Timing: Jan 19 2025 00:09:32
Module start 'layout'
Timing: Jan 19 2025 00:09:32
Module start 'content'
Timing: Jan 19 2025 00:09:33
Module end 'content'
Timing: Jan 19 2025 00:09:33
Script end

Main resources:

Total runtime1.1065 sec
Peak memory usage4,096.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0093 587.7891152.6094
Module start 'layout' 0.00930.0035 740.398439.3984
Module start 'content' 0.01281.0923 779.7969577.9375
Module end 'content' 1.10510.0014 1,357.734412.2031
Script end 1.1065  1,369.9375 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.2993160.0002
Check MTime0.00140.1238160.0001
Mysql Total
Database connection0.00410.374810.0041
Mysqli_queries1.036093.6299590.0176
Looping result0.00070.0662570.0000
Template Total1.070696.820.5353
Template load0.00240.220420.0012
Template processing1.068296.532820.5341
Template load and register function0.00020.020910.0002
states
state_id_array0.00140.128610.0014
state_identifier_array0.00080.075720.0004
Override
Cache load0.00220.1984330.0001
Sytem overhead
Fetch class attribute can translate value0.00170.149730.0006
Fetch class attribute name0.00340.308740.0009
XML
Image XML parsing0.00450.404330.0015
class_abstraction
Instantiating content class attribute0.00000.001440.0000
General
dbfile0.00520.4687160.0003
String conversion0.00000.000840.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 21
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs