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

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

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?