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.