Forums / Setup & design / Display all article of one day

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?

eZ debug

Timing: Jan 18 2025 16:15:03
Script start
Timing: Jan 18 2025 16:15:03
Module start 'content'
Timing: Jan 18 2025 16:15:04
Module end 'content'
Timing: Jan 18 2025 16:15:04
Script end

Main resources:

Total runtime0.9340 sec
Peak memory usage4,096.0000 KB
Database Queries197

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 587.7266180.8359
Module start 'content' 0.00650.7927 768.5625557.5313
Module end 'content' 0.79920.1347 1,326.0938336.7813
Script end 0.9339  1,662.8750 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00500.5327210.0002
Check MTime0.00230.2437210.0001
Mysql Total
Database connection0.00090.096710.0009
Mysqli_queries0.853291.35521970.0043
Looping result0.00230.24241950.0000
Template Total0.905396.920.4527
Template load0.00220.230820.0011
Template processing0.903196.697320.4516
Template load and register function0.00020.024010.0002
states
state_id_array0.00090.099910.0009
state_identifier_array0.00090.091320.0004
Override
Cache load0.00180.1953520.0000
Sytem overhead
Fetch class attribute can translate value0.00120.126130.0004
Fetch class attribute name0.00120.125450.0002
XML
Image XML parsing0.00100.102930.0003
class_abstraction
Instantiating content class attribute0.00000.001550.0000
General
dbfile0.00420.4506270.0002
String conversion0.00000.000630.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
6content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 23
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs