Forums / Developer / menu_folder

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

eZ debug

Timing: Jan 19 2025 02:43:45
Script start
Timing: Jan 19 2025 02:43:45
Module start 'content'
Timing: Jan 19 2025 02:43:46
Module end 'content'
Timing: Jan 19 2025 02:43:46
Script end

Main resources:

Total runtime1.2821 sec
Peak memory usage4,096.0000 KB
Database Queries196

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0077 588.7891180.8516
Module start 'content' 0.00771.1016 769.6406582.9922
Module end 'content' 1.10930.1728 1,352.6328336.7734
Script end 1.2821  1,689.4063 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00430.3321210.0002
Check MTime0.00160.1216210.0001
Mysql Total
Database connection0.00120.094010.0012
Mysqli_queries1.194893.18671960.0061
Looping result0.00290.23001940.0000
Template Total1.246497.220.6232
Template load0.00210.167120.0011
Template processing1.244297.044720.6221
Template load and register function0.00030.021510.0003
states
state_id_array0.00140.106810.0014
state_identifier_array0.00170.135120.0009
Override
Cache load0.00170.1324330.0001
Sytem overhead
Fetch class attribute can translate value0.00140.112240.0004
Fetch class attribute name0.00100.074740.0002
XML
Image XML parsing0.00120.094540.0003
class_abstraction
Instantiating content class attribute0.00000.000740.0000
General
dbfile0.00220.1732270.0001
String conversion0.00000.000630.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 21
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs