top_menu.tpl -> can this be dynamic?

Author Message

Mark Overduin

Tuesday 08 July 2003 2:58:54 am

Everybody knows 'top_menu.tpl' (in the demo). It's the template which contains the menu with the links to every 'subsite'.
But, what if there are... let's say... 10 subsites (and counting!!) and I don't always want to change top_menu.tpl manually.

I want to place a pulldownmenu in top_menu.tpl which contains all the links to the 'subsites' and I want the links to be generated dynamically. Is it possible to do this (using ezP codes; {, }, etc.)? That way I don't always have to change the top_menu.tpl manually.

Tnx, Mark

[edit]
If this does not exist, maybe I can program it myself, but I need to know how and where the folders are saved (tables in db).
[/edit]

Bård Farstad

Tuesday 08 July 2003 5:32:21 am

If your sites are objects in the root of eZ publish, e.g. folders, you can fetch them with a normal fetch function in eZ publish.

See:
http://ez.no/developer/ez_publish_3/documentation/customization/custom_design
The documents database connectivity and examples shows how you can do this.

--bård

Documentation: http://ez.no/doc

Mark Overduin

Wednesday 09 July 2003 12:33:02 am

I managed to get the objects out of a folder in Root, but not the objects IN Root.

My code:
----------
{let folder_list=fetch( content, list, hash(
parent_node_id, 126,
sort_by, array( array( priority ))
)
)
}

<select>
{section name=Folder loop=$folder_list}
<option value="/content/view/full/{$Folder:item.node_id}">{$Folder:item.name|wash}</option>
{/section}
</select>
----------

...where 126 is the ID of the folder in Root.

What needs to be changed to 'receive' the objects in Root?

Mark Overduin

Wednesday 09 July 2003 12:59:11 am

*** removed ***

Somehow, my reply ended up above Bård's reply...

Bård Farstad

Wednesday 09 July 2003 1:00:27 am

Normally 2 is the ID of the root folder, if you've used the standard SQL files.

Mabye you can try this.

--bård

Documentation: http://ez.no/doc

Mark Overduin

Wednesday 09 July 2003 1:06:07 am

Thank you very, very much. This works. Excellent!

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

Main resources:

Total runtime0.0176 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.0067 587.9375152.6250
Module start 'layout' 0.00670.0039 740.562539.4453
Module start 'content' 0.01060.0049 780.007893.3359
Module end 'content' 0.01550.0020 873.343834.3047
Script end 0.0175  907.6484 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002715.1451140.0002
Check MTime0.00126.9707140.0001
Mysql Total
Database connection0.00095.384410.0009
Mysqli_queries0.004123.250230.0014
Looping result0.00000.142510.0000
Template Total0.00169.410.0016
Template load0.00095.019410.0009
Template processing0.00084.326010.0008
Override
Cache load0.00063.494210.0006
General
dbfile0.00021.393680.0000
String conversion0.00000.063840.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