toppath - without root folder?

Author Message

Stefan van Zwoll

Tuesday 25 November 2003 11:07:11 am

hello everyone,

i've got the following problem:

this is my toppath.tpl-file:

{let name=Path
use_urlalias=ezini('URLTranslator','Translation')|eq('enabled')}

 
{section loop=$module_result.path}
{section show=$:item.url}
<a class="kopf" href={cond( and( $:use_urlalias, is_set( $:item.url_alias ) ), $:item.url_alias,
$:item.url )|ezurl}>{$:item.text|shorten( 18 )|wash}</a>
{section-else}
{$:item.text|wash}
{/section}

{delimiter}
<span class="kopf">|</span>
{/delimiter}
{/section}
 

{/let}

it displays a line with the full path starting with the root folder. is there a way to tell ezp3.2 that it displays the path without the root folder as the top node? (my starting page is a "home"-folder in the root folder)

thank you in advance.
stefan

Claus Jensen

Wednesday 26 November 2003 1:50:05 am

Hi Stefan,
sure it is. If you put a section show in there like this:
{section loop=$module_result.path}
{* SHOW, IF YOUR NODE ID IS NOT 2, NORMALLY ROOT FOLDER*}
{section show=ne($:item.node_id, 2)}

{section show=$:item.url}
<a class="kopf" href={cond( and( $:use_urlalias, is_set( $:item.url_alias ) ), $:item.url_alias,
$:item.url )|ezurl}>{$:item.text|shorten( 18 )|wash}</a>
{section-else}
{$:item.text|wash}
{/section}

{delimiter}
<span class="kopf">|</span>
{/delimiter}
{/section} {*END SECTION *}
{/section}

or something like that.
ps. did not test this, but in prinsiple this should work I think.

regards,
claÜs

Stefan van Zwoll

Wednesday 26 November 2003 7:11:56 am

thank you claus, worked out well for me!

Marco Zinn

Wednesday 26 November 2003 2:57:03 pm

Instead of checking for a node, you also could use the offset parameter of the "section" command.
Something like
{section loop=<path> offset=1}
should skip the first item in the list, which probably is "root" ;)
We use this to skip the first 1 or 2 levels of longs paths.

Marco
http://www.hyperroad-design.com

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 05:33:20
Script start
Timing: Jan 31 2025 05:33:20
Module start 'layout'
Timing: Jan 31 2025 05:33:20
Module start 'content'
Timing: Jan 31 2025 05:33:20
Module end 'content'
Timing: Jan 31 2025 05:33:20
Script end

Main resources:

Total runtime0.0167 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.0072 588.1328151.2109
Module start 'layout' 0.00720.0022 739.343836.6484
Module start 'content' 0.00950.0057 775.992294.1406
Module end 'content' 0.01520.0015 870.132833.9922
Script end 0.0167  904.1250 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002615.3582140.0002
Check MTime0.00116.5978140.0001
Mysql Total
Database connection0.00127.319110.0012
Mysqli_queries0.002615.426630.0009
Looping result0.00000.095510.0000
Template Total0.00126.910.0012
Template load0.00095.458710.0009
Template processing0.00021.417110.0002
Override
Cache load0.00063.820710.0006
General
dbfile0.001810.985880.0002
String conversion0.00000.058540.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