Forums / Setup & design / Treemenu

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

eZ debug

Timing: Jan 18 2025 19:28:37
Script start
Timing: Jan 18 2025 19:28:37
Module start 'content'
Timing: Jan 18 2025 19:28:37
Module end 'content'
Timing: Jan 18 2025 19:28:38
Script end

Main resources:

Total runtime0.1871 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0071 588.9844180.8516
Module start 'content' 0.00710.0057 769.8359101.9375
Module end 'content' 0.01280.1742 871.7734526.2109
Script end 0.1870  1,397.9844 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00361.9062200.0002
Check MTime0.00140.7425200.0001
Mysql Total
Database connection0.00080.449010.0008
Mysqli_queries0.134972.11041410.0010
Looping result0.00261.38361390.0000
Template Total0.173692.810.1736
Template load0.00090.489710.0009
Template processing0.172792.339110.1727
Override
Cache load0.00060.341110.0006
Sytem overhead
Fetch class attribute can translate value0.00070.365210.0007
XML
Image XML parsing0.00030.167910.0003
General
dbfile0.00271.4327200.0001
String conversion0.00000.005530.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0002 secs