Help with horizontal looper code

Author Message

steve walker

Tuesday 09 March 2004 12:10:44 pm

Hi,

I am creating a horizontal subnavigation looper, similar to the type used on the Ez site. The code I have to create sub nav " subnav1 | subnav2 | ..etc" is:

{let mainMenu=treemenu($module_result.path,$module_result.node_id,array('folder','info_page'), 1 )} {section name=Menu loop=$mainMenu}
{section show=$:item.is_selected}

{/section} <a href={$:item.url_alias|ezurl}>{$Menu:item.text}</a>
{section show=$:item.is_selected} {/section}   |   {/section}
{/let}

The problem is that the last loop adds the "|" seperator - so I end up with an ugly " subnav1 | subnav2 | subnav3 |" ..I dont want that last "|"!

Presumably need to put somethnig in the loop saying "if this is the last loop, dont print |" but I'm not that good a coder.

Anyone out there now how to tweak this?

Thanks, Steve

http://www.oneworldmarket.co.uk

Paul Borgermans

Tuesday 09 March 2004 12:48:53 pm

{let mainMenu=treemenu($module_result.path,$module_result.node_id,array('folder','info_page'), 1 )} {section name=Menu loop=$mainMenu}
{section show=$:item.is_selected}

{/section} <a href={$:item.url_alias|ezurl}>{$Menu:item.text}</a>
{section show=$:item.is_selected} {/section}{delimiter}   |  {/delimiter} {/section}
{/let}

see

http://ez.no/ez_publish/documentation/reference/template_functions/program_flow/section

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

steve walker

Tuesday 09 March 2004 1:08:10 pm

Paul,

Thankyou very much. Steve

http://www.oneworldmarket.co.uk

ashok ashok

Monday 19 April 2004 1:54:48 am

I am very new to ezpublish. I was jut trying to understand the following code.

 <div id="submenu">
        <div class="design">
            <h3 class="invisible">Sub menu</h3>
            <ul>
                {let mainMenu=treemenu($module_result.path,$module_result.node_id,array('folder','info_page'), 1 )}
                    {section name=Menu loop=$mainMenu}
            	    {section show=$:item.is_selected}
            
                        {/section}
            
                        <li class="level_{$:item.level}">
                           <a href={$:item.url_alias|ezurl}>{$Menu:item.text}</a>
                        </li>
            
            	    {section show=$:item.is_selected}
            
                        {/section}
                    {/section}
                {/let}
            </ul>
        
        </div>
    </div>

I understood that this code is loop which displays the link.i.e {let mainMenu=treemenu($module_result.path,$module_result.node_id,array('folder','info_page'), 1 )}
But i have not understood the follwing code in it i.e

{section show=$:item.is_selected}
{/section}

. Removed this code from both the places but still it works fine. Please any one can tell me why this code is written and what is the purpose of this code or please tell me the exact working of the full code.
Thanks In advance
Ashok Naidu

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

Main resources:

Total runtime0.0188 sec
Peak memory usage4,096.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.0030 740.562539.4453
Module start 'content' 0.00970.0068 780.007893.4609
Module end 'content' 0.01650.0023 873.468834.3047
Script end 0.0188  907.7734 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002815.1048140.0002
Check MTime0.00136.6401140.0001
Mysql Total
Database connection0.00094.742010.0009
Mysqli_queries0.002312.045630.0008
Looping result0.00000.127910.0000
Template Total0.00189.610.0018
Template load0.00094.891410.0009
Template processing0.00094.636910.0009
Override
Cache load0.00063.430210.0006
General
dbfile0.00063.311280.0001
String conversion0.00000.064640.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