Howto set max loop on month name to 1 in a calendar listing events

Author Message

K259

Monday 19 April 2004 8:15:43 am

I have a calendar which prints out events on a page of class id 8.
The events comes with date, title and description, like this:

"Date: 2004, 03.05", Title: Mac design, Description: bla bla bla..

I want to make the page look like this with sorting by months:

Mars
"Date: 2004, 03.05", Title: Mac design, Description: bla bla bla..

May
"Date: 2004, 05.05", Title: eZ design, Description: bla bla bla..

BUT the question is when I add case match for 01 which is January in the line_class_8.tpl I get a loop for the monthname..I only want the name of the month to print only once.
Tried to set a variable in the template to check when the monthname is printed once, but won't help :(

I have a pagelayout with:

{section name=Child loop=sort($child_list)}

<tr>
    <td valign="top">
        {node_view_gui view=line content_node=$Center:Child:item}
    </td>
</tr>{/section}

Child:item uses line_class_8.tpl for viewing..with the code:

{switch match=$node.object.data_map.from_date.content.timestamp|datetime(custom,"
%m")}
{case match="01"}
{section show=ne($val,2)}
{let val=2}
{section show=eq($val,2)}
January
{/section}{/let}{/section}{/case}

I tried to make something with the section..val etc., but it's printing out January for every events..I only want January to appear only once.

I wanna know how is it possible to write this in the ez template:

{if not eq($bol,1)
let bol=1}
{section show=eq($bol,1)}
January{/section}

Dominik Pich

Thursday 22 April 2004 1:23:05 am

{let b=1}
{section loop=item}
{section show=eq(b,1)}
write some
{set b=0}
{/section}
{/section}

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 07:06:39
Script start
Timing: Jan 19 2025 07:06:39
Module start 'layout'
Timing: Jan 19 2025 07:06:39
Module start 'content'
Timing: Jan 19 2025 07:06:40
Module end 'content'
Timing: Jan 19 2025 07:06:40
Script end

Main resources:

Total runtime1.6282 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0059 589.4141152.6563
Module start 'layout' 0.00590.0043 742.070339.5234
Module start 'content' 0.01021.6166 781.5938467.1250
Module end 'content' 1.62670.0014 1,248.71888.0938
Script end 1.6282  1,256.8125 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.2101160.0002
Check MTime0.00140.0838160.0001
Mysql Total
Database connection0.00130.076910.0013
Mysqli_queries1.580597.0711540.0293
Looping result0.00060.0340520.0000
Template Total1.580897.120.7904
Template load0.00230.143820.0012
Template processing1.578496.941620.7892
Template load and register function0.00020.013910.0002
states
state_id_array0.00180.107510.0018
state_identifier_array0.00140.089020.0007
Override
Cache load0.00190.1194280.0001
Sytem overhead
Fetch class attribute can translate value0.00080.046120.0004
Fetch class attribute name0.00120.072820.0006
XML
Image XML parsing0.00030.016320.0001
class_abstraction
Instantiating content class attribute0.00000.000420.0000
General
dbfile0.00080.0470100.0001
String conversion0.00000.000540.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
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.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/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: 19
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs