Forums / Setup & design / top_menu.tpl -> can this be dynamic?

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!

eZ debug

Timing: Jan 30 2025 21:25:09
Script start
Timing: Jan 30 2025 21:25:09
Module start 'content'
Timing: Jan 30 2025 21:25:09
Module end 'content'
Timing: Jan 30 2025 21:25:09
Script end

Main resources:

Total runtime0.2205 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0080 587.9531370.2891
Module start 'content' 0.00800.0132 958.24221,005.5313
Module end 'content' 0.02120.1992 1,963.77343,894.4922
Script end 0.2204  5,858.2656 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00452.0427200.0002
Check MTime0.00140.6132200.0001
Mysql Total
Database connection0.00090.405910.0009
Mysqli_queries0.124956.63221410.0009
Looping result0.00140.63381390.0000
Template Total0.198890.110.1988
Template load0.00080.360510.0008
Template processing0.197989.782310.1979
Override
Cache load0.00060.250410.0006
Sytem overhead
Fetch class attribute can translate value0.00210.970610.0021
XML
Image XML parsing0.00020.108510.0002
General
dbfile0.00823.7101200.0004
String conversion0.00000.003230.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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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