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