ezmatrix.tpl override problems

Author Message

Helle Andersen

Friday 16 July 2004 6:58:15 am

I have tried to override the matrix datatype in ezmatrix.tpl.
I want to make alternating blue and tan colored lines using sequense, but I cannot get more than the first tabledata (i.e. the first column) to alternate. No. 2 column remains white
The code runs as follows:
<tr>
{section name=Rows loop=$matrix.rows.sequential sequence=array(tanbg,lightbluebg)}

<td class="{$:sequence}">
{section name=Columns loop=$Rows:item.columns}
{$Rows:Columns:item|wash(xhtml)}   
{delimiter}
</td>

<td class="{$:sequence}">

{/delimiter}

{/section}
</td>

{delimiter}
</tr>

<tr>
{/delimiter}
{/section}

</tr>

Any suggestions ?

Helle Damgaard

Alex Jones

Friday 16 July 2004 9:36:31 am

I think you have mixed a couple of tags that should be separate.

Try something like this:

<tr>
{sequence name=Seq loop=array(tanbg,tanbg,lightbluebg,lightbluebg)}
{section name=Rows loop=$matrix.rows.sequential} 
<td class="{$:sequence}">
{section name=Columns loop=$Rows:item.columns}
{$Rows:Columns:item|wash(xhtml)}&nbsp;&nbsp;&nbsp;
{sequence name=Seq}
{delimiter}
</td>
<td class="{$:sequence}">
{/delimiter}
{/section}
</td>
{delimiter}
</tr>
<tr>
{/delimiter}
{/section}
</tr>

The code may not be perfect, but it should get you closer.

<b>Related Documentation</b>
Complext List with Colors: http://ez.no/ez_publish/documentation/customization/custom_design/examples/common_template_issues/complex_list_with_colours
Sequence: http://ez.no/ez_publish/documentation/development/libraries/ez_template/functions/sequence

Alex
bald_technologist on the IRC channel: #eZpublish
http://www.agrussell.com :: http://www.cuttingedge.com

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Helle Andersen

Thursday 05 August 2004 5:34:26 am

Doesn't work - doesn't even make the first row coloured ...

Hans Melis

Thursday 05 August 2004 12:01:52 pm

The second {$:sequence} should result in a template error/warning. You're using the 'name' attribute of the section command, which means you're using namespaces. The $: is a special reference because it refers to the current namespace (current meaning the most specific namespace where your code is run).

In simple terms, this means that the first {$:sequence} actually means {$Rows:sequence}, which is correct. The second {$:sequence} is in a more specific namespace and is translated into {$Rows:Columns:sequence}, but the Columns namespace doesn't have a sequence variable.

So you should change the second {$:sequence} to {$Rows:sequence}.

hth

--
Hans

Hans
http://blog.hansmelis.be

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 13:54:04
Script start
Timing: Jan 19 2025 13:54:04
Module start 'layout'
Timing: Jan 19 2025 13:54:04
Module start 'content'
Timing: Jan 19 2025 13:54:04
Module end 'content'
Timing: Jan 19 2025 13:54:04
Script end

Main resources:

Total runtime0.6894 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0048 590.2891152.6250
Module start 'layout' 0.00480.0024 742.914139.4453
Module start 'content' 0.00730.6808 782.3594595.5781
Module end 'content' 0.68800.0013 1,377.937512.1641
Script end 0.6894  1,390.1016 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.4600160.0002
Check MTime0.00140.1998160.0001
Mysql Total
Database connection0.00070.103310.0007
Mysqli_queries0.630991.5149620.0102
Looping result0.00050.0719600.0000
Template Total0.662696.120.3313
Template load0.00180.256320.0009
Template processing0.660895.856520.3304
Template load and register function0.00020.035710.0002
states
state_id_array0.00100.146410.0010
state_identifier_array0.00080.115920.0004
Override
Cache load0.00150.2197480.0000
Sytem overhead
Fetch class attribute can translate value0.00050.070330.0002
Fetch class attribute name0.00080.116760.0001
XML
Image XML parsing0.00731.060130.0024
class_abstraction
Instantiating content class attribute0.00000.001560.0000
General
dbfile0.00741.0781210.0004
String conversion0.00000.001040.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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
12content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/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: 29
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs