Forums / Setup & design / How to create an override template for node_list?

How to create an override template for node_list?

Author Message

Badger Mushroom

Friday 14 January 2005 8:27:32 am

Hi, I just installed EZpublish, and noticed the right toolbar contains this node_list. I was able to enable/disable node_list, but I would like to edit the node_list template.

But then inside the /design/standard/templates/toolbar/full/node_list.tpl, I was told to use override template instead. I was wondering where this node_list can be found under the 'never ending' template list so I can add an override. Thanks.

{* DO NOT EDIT THIS FILE! Use an override template instead. *}
{section show=or($show_subtree|count_chars()|eq(0), $requested_uri_string|begins_with( $show_subtree ))}
{cache-block keys=$tool_id}
{default limit=5}
{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>{$title}</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}
    {/section}
    </div>
    </div>
</div>

{/let}
{/default}
{/cache-block}

Kristian Hole

Saturday 15 January 2005 5:10:20 am

If you have a template and want to change this (and override it). Copy it to your design in the same directory structure.
Example:
copy
/design/standard/templates/toolbar/full/node_list.tpl to
/design/YOURDESIGN/templates/toolbar/full/node_list.tpl

where YOURDESIGN is the one specified in the <i>SiteDesign</i> of <i>[DesignSettings]</i> in <i>site.ini.append.php</i> of your siteaccess.

Remember to clear the cache after you copied it.

Kristian

http://ez.no/ez_publish/documenta...tricks/show_which_templates_are_used
http://ez.no/doc/ez_publish/techn...te_operators/miscellaneous/attribute

Badger Mushroom

Saturday 15 January 2005 9:43:29 am

Thanks,

I have three questions.

In my site.ini..., I saw the following:
[DesignSettings]
SiteDesign=plain
AdditionalSiteDesignList[]=base

What does AdditionalSiteDesignList mean, and how does 'base' design affect my 'plain' site design?

Also, in my /design/plain/templates/, there's no more directories that lead to /design/plain/templates/toolbar/full/. Does this mean I have to create my own and that EZPublish will be able to recongize my dir changes?

Kristian Hole

Monday 17 January 2005 1:05:04 am

In my site.ini..., I saw the following:
[DesignSettings]
SiteDesign=plain
AdditionalSiteDesignList[]=base

What does AdditionalSiteDesignList mean, and how does 'base' design affect my 'plain' site design?

The short answer is: When eZ publish looks for a template, it starts looking in SiteDesign. If it finds the template there it uses that, otherwise it looks through all your Additional designs (Specified in AdditionalSiteDesignList). If the template is not found there either, it looks in StandardDesign.

http://ez.no/ez_publish/documentation/incoming/design/siteaccess_configuration

Also, in my /design/plain/templates/, there's no more directories that lead to /design/plain/templates/toolbar/full/. 
Does this mean I have to create my own and that EZPublish will be able to recongize my dir chang

Yes. When you create the new dirs in the plain design eZ publish will automatically find them (but remember to clear the cache).

Kristian

http://ez.no/ez_publish/documenta...tricks/show_which_templates_are_used
http://ez.no/doc/ez_publish/techn...te_operators/miscellaneous/attribute