Display all article of one day

Author Message

John van der Boom

Sunday 20 July 2003 3:52:17 pm

Hi there,

I'm trying to accomplish this:
I have a lot of news and I want to show them by date
Something like this:

Sunday 21 July 2003
- News 1 of 2i july 2003
- News 2 ...
- News 3 ...

Saturday 20 July 2003
- News 1 of 20 July 2003
- News 2 ...

etc

This for a whole week.

So I need eZp to not only sort the date with fetch but to know if the date of the article is the date of the group.

Can you help me, because I dont know where to begin :-(

Thank you in advance

liu spider

Sunday 20 July 2003 7:40:48 pm

sort your fetch by date ( better set a limit parameter), that makes sure all the articles published in the same day stay together.

second, use datetime and currentdate operators to filter the lists, and then display them

http://liucougar.scim-im.org
SCIM Input Method Platform
http://scim.sf.net
SJSD Online Editor
http://sf.net/projects/sjsd

John van der Boom

Monday 21 July 2003 4:54:18 pm

Thank you all take a look at these operators.

John van der Boom

Wednesday 30 July 2003 7:33:33 am

I came up with this:

{let today=currentdate()|datetime(custom,"%d%m%y") startdate=0 news_list=fetch(content,tree,hash(parent_node_id,$node.node_id,limit,10,depth,3,sort_by,array(published,false()),offset,$front_news,class_filter_type,include,class_filter_array,array(31)))}
{section name=News loop=$news_list}
{switch name=Sw1 match=$News:item.object.published|datetime(custom,"%d%m%y")}
{case match=$today}
Today's news
{node_view_gui view=line content_node=$News:item}
{/case}
{case match=$startdate}
{node_view_gui view=line content_node=$News:item}
{/case}
{case}
News of {$News:item.object.published|datetime(custom,"%d%m%y")}
{node_view_gui view=line content_node=$News:item}
{/case}
{/switch}
<table class="layout" width="100%" align="center" border="0" cellpadding="0" cellspacing="0"><tr><td height="1" background={"blueline.gif"|ezimage}></td></tr></table>
{set startdate=$News:item.object.published|datetime(custom,"%d%m%y")}
{/section}
{/let}

But the line
{set startdate=$News:item.object.published|datetime(custom,"%d%m%y")}

is giving me problem!

I get this error:
Variable 'News:startdate' doesn't exist, cannot set

What's the meaning of this error? And how can I solve this?

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 31 2025 04:16:50
Script start
Timing: Jan 31 2025 04:16:50
Module start 'layout'
Timing: Jan 31 2025 04:16:50
Module start 'content'
Timing: Jan 31 2025 04:16:50
Module end 'content'
Timing: Jan 31 2025 04:16:50
Script end

Main resources:

Total runtime0.0126 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0048 588.1328151.2109
Module start 'layout' 0.00480.0026 739.343836.6641
Module start 'content' 0.00740.0038 776.007894.1406
Module end 'content' 0.01120.0014 870.148433.9922
Script end 0.0126  904.1406 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002318.5820140.0002
Check MTime0.00108.2109140.0001
Mysql Total
Database connection0.00086.544910.0008
Mysqli_queries0.002519.449830.0008
Looping result0.00000.094310.0000
Template Total0.00118.410.0011
Template load0.00086.463810.0008
Template processing0.00021.907410.0002
Override
Cache load0.00064.701610.0006
General
dbfile0.00032.215080.0000
String conversion0.00000.039640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs