Tool Bar ---make the title a link

Author Message

Kevin Myles

Monday 12 July 2004 2:46:20 pm

I am trying to modify my toolbars so that for tools that are node lists, the title is a link to that Node_ID/folder (as selected in the toolbar admin), so you can click on the toolbar title and see all the articles of the selected node, instead of just the 5 in the toolbar.
i've been playing around with toolbar/full/node_list.tpl but no matter what I try, the link is just to the main page

{cache-block keys=$tool_id}
{default limit=5} {section show=or($show_subtree|count_chars()|eq(0), $requested_uri_string|begins_with( $show_subtree ))}
{section show=$sort_by|count|eq( 0 )}{set sort_by='published'}{/section}
{let node_list=cond( $treelist_check|eq( 'yes' ),
                         fetch( content, tree, hash( parent_node_id, $parent_node,
                                limit, $limit,
                                class_filter_type, exclude,
                                class_filter_array, array( 'folder' ),
					            sort_by, array( $sort_by, false() ) ) ),
                     fetch( content, list, hash( parent_node_id, $parent_node,
                            limit, $limit,
                            class_filter_type, exclude,
                            class_filter_array, array( 'folder' ),
				            sort_by, array( $sort_by, false() ) ) ) )}
<div class="toollist">
    <div class="toollist-design">
    <h2><a href={$node:item.url_alias|ezurl}>{$title}</a></h2>
    <div class="content-view-children">
    {section name=Node loop=$node_list sequence=array(bglight,bgdark)}
        {node_view_gui view=listitem content_node=$Node:item}

i modified the code by putting in

<a href={$node:item.url_alias|ezurl}> </a>

I've just been palying around with the operator, and no matter what I put infront of item.url_alias|ezurl , the link just goes to the main front page. I've been at this for a day and a half, so any help is much appreciated.
Many thanks in return for help!

Bruce Morrison

Monday 12 July 2004 4:25:09 pm

Hi Kevin

You need to retrieve the node first

Try:

{let node=fetch(content,node,hash(node_id,$parent_node))}
<a href={$node.url_alias|ezurl}>{$title}</a>
{/let}

Cheers
Bruce http://www.designit.com.au/

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Kevin Myles

Monday 12 July 2004 8:47:04 pm

Bruce, thanks for your reply, mate.
I've tried my best to use your code, but it's not working. I think you're right that i need to add a fetch for the node, but i wonder if the syntax is wrong somehow?

I've tried tweaking it several times (moving the {/let}, droping the "$" from the fetch.

in my full folder view template override, i know this retrieves the subfolder names of the containing folder

{section name=Folder loop=$folder_list}

should i add something like this? it seems like a strech, but again i can't make your suggestion work. any ideas?

Anyway, thanks again for your support!

Bruce Morrison

Monday 12 July 2004 9:19:50 pm

I've edited the original message and fixed up some mistakes.

I really should have some coffee before I do _anything_ in the morning ;)

Cheers
Bruce http://www.designit.com.au/

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Kevin Myles

Tuesday 13 July 2004 8:23:42 am

Bruce,
thank you so much. it works perfectly now.
Cheers, Kevin.

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 19 2025 09:11:30
Script start
Timing: Jan 19 2025 09:11:30
Module start 'layout'
Timing: Jan 19 2025 09:11:30
Module start 'content'
Timing: Jan 19 2025 09:11:31
Module end 'content'
Timing: Jan 19 2025 09:11:31
Script end

Main resources:

Total runtime1.0400 sec
Peak memory usage4,096.0000 KB
Database Queries63

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 589.1563152.6250
Module start 'layout' 0.00570.0031 741.781339.4609
Module start 'content' 0.00881.0297 781.2422564.7578
Module end 'content' 1.03850.0015 1,346.000016.1563
Script end 1.0400  1,362.1563 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.3473160.0002
Check MTime0.00140.1349160.0001
Mysql Total
Database connection0.00090.090010.0009
Mysqli_queries0.982194.4279630.0156
Looping result0.00060.0574610.0000
Template Total1.000596.220.5003
Template load0.00250.237620.0012
Template processing0.998095.962020.4990
Template load and register function0.00010.013810.0001
states
state_id_array0.00100.091810.0010
state_identifier_array0.00150.148820.0008
Override
Cache load0.00210.2035360.0001
Sytem overhead
Fetch class attribute can translate value0.00050.046920.0002
Fetch class attribute name0.00110.102260.0002
XML
Image XML parsing0.00050.047320.0002
class_abstraction
Instantiating content class attribute0.00000.001470.0000
General
dbfile0.00080.0769160.0000
String conversion0.00000.000940.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
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/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: 29
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs