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.