Create two override template for two different node_list

Author Message

Manuela Pedrotti

Tuesday 04 July 2006 6:14:30 am

Hi,

I created in right toolbar two node_list and i want override each node_list with a different template!
How can I do it?

Evgeniy K

Tuesday 04 July 2006 1:12:30 pm

Hello, Manuela.

Sorry for my bad English, I'm Russian.

You can creat a new tool for toolbar, for example "node_list2", add it to your toolbar too, and make different template overrides for "node_list" and "node_list2".

You must add to the file toolbar.ini.append.php located at settings/siteaccess/your_site_name/toolbar.ini.append.php

[Tool]
AvailableToolArray[]=node_list2

[Tool_node_list2]
parent_node=2
title=Latest items
show_subtree=
limit=5
sort_by=published
treelist_check=yes

[Tool_node_list2_description]
parent_node=Item source
title=Title
show_subtree=Show in subtree
limit=Number of items
sort_by=Sort on attribute
treelist_check=Fetch whole tree?

Then you must create 2 templates for this tool, both are called node_list2.tpl. Just duplicate the files "node_list.tpl" and call them "node_list2.tpl". The location of node_list2.tpl must be the same as location of node_list.tpl : the first file (source, node_list.tpl, and your new file node_list2.tpl) location is design/standard/templates/toolbar/full/ , and the second file locate at design/standard/templates/toolbar/line/. Duplicate them, rename to node_list2.tpl, and enjoy.
Now you can add different node lists to your toolbar, and create different overrides for node_list.tpl and node_list2.tpl, even if both of them are located on the same page.

And if your 2 node lists are on the different pages, it is much easier: you can use "match" condition in override.ini.append.php . For example, to apply override only for main page:

Match[node]=2

Best regards, Evgeniy.

Manuela Pedrotti

Wednesday 05 July 2006 1:55:30 am

Hi Evgeniy,

its work!!

Best regard
Manuela

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 00:55:43
Script start
Timing: Jan 19 2025 00:55:43
Module start 'layout'
Timing: Jan 19 2025 00:55:43
Module start 'content'
Timing: Jan 19 2025 00:55:44
Module end 'content'
Timing: Jan 19 2025 00:55:44
Script end

Main resources:

Total runtime0.8669 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0137 589.4141152.6563
Module start 'layout' 0.01370.0041 742.070339.5078
Module start 'content' 0.01780.8477 781.5781472.8516
Module end 'content' 0.86550.0014 1,254.429712.4063
Script end 0.8669  1,266.8359 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.01031.1901160.0006
Check MTime0.00130.1521160.0001
Mysql Total
Database connection0.00110.130410.0011
Mysqli_queries0.812293.6930570.0142
Looping result0.00050.0549550.0000
Template Total0.821294.720.4106
Template load0.00200.230920.0010
Template processing0.819294.497920.4096
Template load and register function0.00020.024710.0002
states
state_id_array0.00190.219510.0019
state_identifier_array0.00150.176120.0008
Override
Cache load0.00160.1879220.0001
Sytem overhead
Fetch class attribute can translate value0.00070.083520.0004
Fetch class attribute name0.00100.118530.0003
XML
Image XML parsing0.00020.024620.0001
class_abstraction
Instantiating content class attribute0.00000.000730.0000
General
dbfile0.00280.3281100.0003
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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 17
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs