Treemenu with several subfolders

Author Message

glenn terjesen

Monday 07 March 2005 11:49:44 pm

hi, im having trouble creating a treemenu on one of my subpages.
I've successfully created a treemenu with one sublevel with help from your
"howto" :The links page::Creating a tree-style appearence

example :

-menu
--article1
--article2
-menu2
--article3

But I need one folder more like this:

-menu
--submenu1
---article1
---article2
--submenu2
---article3

I know there's a javascript popupmenu, but with very poor docs..
Is it possible to get some help/guide to get this work ?
Anyone got any examples perhaps..

Thx

Ɓukasz Serwatka

Tuesday 08 March 2005 12:04:50 am

Hi,

You should add one level more. Here is good example to fourth level.
http://ez.no/ez_publish/documentation/customization/tips_tricks/creating_tree_menus

I hope it will help.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

glenn terjesen

Tuesday 08 March 2005 1:29:28 am

Thx alot :)
had to change the line "....class_filter_array, array(1)..." to
"...class_filter_array, array('article','folder')..." to show articles..
hmm.. found another problem
How to make a {switch} based on to show the contents of a folder or a article..
I can paste both the design/base/override/templates/full/article.tpl and the folder.tpl
into my .tpl file.. but creates alot of errors in debug mode.

glenn terjesen

Tuesday 08 March 2005 3:13:28 am

*solved nearly*
Howto find out if a object is a article or a folder:

{switch match=$node.object.contentclass_id}
{case match=1} {*folder*}
List articles from current folder
{/case}
{case match=2} {*article*}
List articles from parent folder
{/case}
{/switch}

hmm.. now i need something to bypass the damn cache..

Eivind Marienborg

Tuesday 08 March 2005 3:28:14 am

To bypass cache, add this to the beginning of your template:

{set-block scope=root variable=cache_ttl}0{/set-block}

glenn terjesen

Tuesday 08 March 2005 4:10:43 am

Weird..
The {switch} works..
If I click a article first(after i cleared the cache) in my menu, the articles show perfectly, but not the contents of the folders. and visa versa.

didnt't help to insert a cache block on the top of my .tpl file.

did it make any sense ?

glenn terjesen

Tuesday 08 March 2005 4:40:24 am

bah :)
solved dumped the switch, created two templates, one for articles and one for folders.
works like a charm :)

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 18 2025 21:10:42
Script start
Timing: Jan 18 2025 21:10:42
Module start 'layout'
Timing: Jan 18 2025 21:10:42
Module start 'content'
Timing: Jan 18 2025 21:10:42
Module end 'content'
Timing: Jan 18 2025 21:10:42
Script end

Main resources:

Total runtime0.0164 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0062 587.9375152.6250
Module start 'layout' 0.00620.0027 740.562539.4453
Module start 'content' 0.00890.0053 780.007893.4609
Module end 'content' 0.01420.0022 873.468838.3047
Script end 0.0164  911.7734 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002616.0221140.0002
Check MTime0.00127.2394140.0001
Mysql Total
Database connection0.00127.419710.0012
Mysqli_queries0.002414.878830.0008
Looping result0.00000.158510.0000
Template Total0.001810.910.0018
Template load0.00116.625610.0011
Template processing0.00074.253210.0007
Override
Cache load0.00063.409510.0006
General
dbfile0.00116.641680.0001
String conversion0.00000.048040.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