Presenting links in dynamic menu

Author Message

Halvor M

Sunday 06 March 2005 8:59:56 am

Hi,
I originally installed EZ on my server just to play around, but have ended up creating this site: http://www.jusnytt.no

I have made a collection of links (under the "Lenker" menu). The default setting for the links is that the contents of each submenu or category is showed in the main page, with both description and full URL.

I intent to alter this configuration - but I suppose that this is an area where there are many examples of more efficient template codes than I could hope to produce myself.

I am making the left menu dynamic, where the links are to be presented as clickable items in the main page (without the double reference of clickable description and full URL).

Lett me know if you have input on this - would save me the hassle of recoding elementary stuff.

<b>Thanks !</b>

Halvor

Ɓukasz Serwatka

Sunday 06 March 2005 10:21:23 pm

Hi Halvor,

Welcome to eZ publish Comminity!

In design/base/templates/menu/ is sub_left.tpl file. There you can make edits. Use section to check object class id. If object class id is "link" then show only URLs. Good example is in double_top.tpl file.
http://ez.no/ez_publish/documentation/reference/template_functions/program_flow/section

I hope it will help.

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

Halvor M

Monday 07 March 2005 3:17:21 pm

Thanks, I looked in the sub_left.tpl file. It looks like this:

<div id="leftmenu">
<div id="leftmenu-design">

<h3 class="hide">{"Left sub menu"|i18n("design/base")}</h3>

{section show=and( is_set( $module_result.path[1] ), is_set( $module_result.node_id ) )}
{let root_node=fetch( content, node, hash( node_id, 2 ) )
     submenu=fetch( content, list, hash( parent_node_id, $module_result.path[1].node_id,
                                         class_filter_type, include,
                                         class_filter_array, ezini( 'MenuContentSettings', 'LeftIdentifierList', 'menu.ini' ),
                                         sort_by, $root_node.sort_array ) )}
    <ul>
    {section var=menu loop=$submenu}
        <li class="menu-level-0"><a href={$menu.url_alias|ezurl}>{$menu.name|shorten( 25 )}</a></li>
    {/section}

    {section show=$submenu|count}
    <li class="menu-level-0"></li>
    {/section}
    </ul>

    <div class="breakall"></div>

{/let}
{/section}

</div>
</div>

The URL ref's would be altered to a dynamic tree content-menu.

Halvor

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

Main resources:

Total runtime0.0239 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 588.1563151.2109
Module start 'layout' 0.00550.0040 739.3672220.6875
Module start 'content' 0.00950.0128 960.0547997.9297
Module end 'content' 0.02230.0015 1,957.984433.9922
Script end 0.0239  1,991.9766 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002610.6750140.0002
Check MTime0.00104.1086140.0001
Mysql Total
Database connection0.00114.442810.0011
Mysqli_queries0.003012.656030.0010
Looping result0.00000.053910.0000
Template Total0.00114.510.0011
Template load0.00083.229810.0008
Template processing0.00031.225910.0003
Override
Cache load0.00052.242310.0005
General
dbfile0.00166.772980.0002
String conversion0.00000.020940.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