Treemenu

Author Message

Daniel Hubbell

Saturday 20 August 2005 8:32:38 pm

Treemenu requires a path parameter and the documentation states this would normally be $module_result.path. However, $module_result.path seems to be not available in display templates. Is there another variable I can use in its place or is treemenu just not usable outside of the pagelayout template? This question has been asked 1/2 dozen times in the forums but has never been answered.

Could someone answer this question so I can move on.

Thank you,

Dan Hubbell
Gobles Public Schools

Peter Dabrowski

Wednesday 24 August 2005 4:56:47 am

I've got the same problem.
Trying to have breadcrumbs navigation in one section only.

I"m trying to use path_array in code below, but cannot get names displayed

{section name=Path loop=$node.path_array }
{section show=$Path:item.url}
<a href={$Path:item.url_alias|ezurl}>{$Path:item.text|shorten(50)}</a>
{section-else}
{$Path:item.text|shorten(50)}
{/section}
{delimiter}&gt;{/delimiter}
{/section}

So I would like to hear on this subject to.
Thanks
Peter

David Eriksson

Wednesday 24 August 2005 5:46:54 am

You can "build" your own path variable.

{set $path=array(
                hash('text', $specialnode.parent.parent.name, 'url', concat('/content/view/full/', $specialnode.parent.parent_node_id), 'url_alias', $specialnode.parent.parent.url_alias, 'node_id', $specialnode.parent.parent_node_id),
                hash('text', $specialnode.parent.name, 'url', concat('/content/view/full/', $specialnode.parent_node_id), 'url_alias', $specialnode.parent.url_alias, 'node_id', $specialnode.parent_node_id),
                hash('text', $specialnode.name, 'url', false(), 'url_alias', false(), 'node_id', '365')
                )}

The longer path you need, the more work it is obviously. The path above has 3 levels. Play around with it, and print out the ordinary treemenu() with attribute(show) and you should be able to puzzle it together. :)

/David

Peter Dabrowski

Sunday 28 August 2005 12:30:07 am

Hi David,

Tried to print {treemenu()|attribute(show)} but getting only headers.

Peter

Peter Dabrowski

Sunday 28 August 2005 12:35:05 am

Hi,
This code showing the path as what I want.
Haw to make it clicable?
I want to come back to one of previous pages.
{section loop=$node.path_array offset=2}
{let node_name=fetch( content, node, hash( node_id, $item ) )}
{$node_name.name}
{/let}
{delimiter}
>
{/delimiter}
{/section}

Thanks
Peter

Kristof Coomans

Sunday 28 August 2005 4:28:15 am

You can make it clickable by using $node.url_alias and ezurl. Don't forget to wash the node's name!

{section loop=$node.path_array offset=2}
    {let node_name=fetch( content, node, hash( node_id, $item ) )}
        <a href={$node.url_alias|ezurl}>{$node_name.name|wash}</a>
{/let}
{delimiter}
&gt;
{/delimiter}
{/section}

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Peter Dabrowski

Sunday 28 August 2005 6:02:13 am

Thanks Kristof,

I've changed:
<a href={$node.url_alias|ezurl}>{$node_name.name|wash}</a>

to read:

<a href={$node_name.url_alias|ezurl}>{$node_name.name|wash}</a>

working code:

{section loop=$node.path_array offset=2}
{let node_name=fetch( content, node, hash( node_id, $item ) )}
<a href={$node_name.url_alias|ezurl}>{$node_name.name|wash}</a>

{/let}
{delimiter}
&gt;
{/delimiter}
{/section}

Another question:
How to change this code so current node is printed as a text only , and is not clicable?

Thanks
Peter

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

Main resources:

Total runtime0.9009 sec
Peak memory usage4,096.0000 KB
Database Queries73

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0066 589.5625152.6094
Module start 'layout' 0.00660.0032 742.171939.3984
Module start 'content' 0.00980.8897 781.5703661.1250
Module end 'content' 0.89940.0014 1,442.695316.2031
Script end 0.9009  1,458.8984 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.3862160.0002
Check MTime0.00140.1524160.0001
Mysql Total
Database connection0.00080.088410.0008
Mysqli_queries0.830592.1817730.0114
Looping result0.00080.0875710.0000
Template Total0.861595.620.4307
Template load0.00270.296120.0013
Template processing0.858895.324920.4294
Template load and register function0.00030.029010.0003
states
state_id_array0.00240.266610.0024
state_identifier_array0.00150.164120.0007
Override
Cache load0.00240.2685700.0000
Sytem overhead
Fetch class attribute can translate value0.00070.080240.0002
Fetch class attribute name0.00170.185980.0002
XML
Image XML parsing0.00090.105140.0002
class_abstraction
Instantiating content class attribute0.00000.001480.0000
General
dbfile0.00100.1105160.0001
String conversion0.00000.001140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
16content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
10content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 38
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs