#1 2016-03-30 14:52:20

PGrafiek
Member
Registered: 2013-03-18
Posts: 24

[SOLVED] Filter and logical_date

Hi,

I would like to select articles where logical_date is greater than today.

This is what i tried :

<?php $today = date('Y-m-d'); ?>
<ion:articles filter="article.logical_date.gt(<?php $today; ?>)">

I was inspired by this topic:
filter="page.id_parent=1 AND YEAR(article.logical_date) = 2015"


Otherwise, where can i read about "filter" in ionize documentation ?

Thanks

Last edited by PGrafiek (2016-03-31 10:39:49)

Offline

#2 2016-03-30 15:44:44

adaliszk
Ionize Friend
From: Germany
Registered: 2010-09-20
Posts: 397
Website

Re: [SOLVED] Filter and logical_date

Hello here!

Try use this:

<ion:articles filter="article.logical_date >= CURRENT_DATE">

Best Regards,
Adamos42


Webdeveloper, Programmer, Application developer, Ionize friend
@adaliszk

Offline

#3 2016-03-30 16:02:26

PGrafiek
Member
Registered: 2013-03-18
Posts: 24

Re: [SOLVED] Filter and logical_date

Thank you !

It works with :

filter="(article.logical_date).gt(CURRENT_DATE)"

The problem now is that "Pagination" does not work any more...
Any idea ?

Offline

#4 2016-03-30 16:57:28

adaliszk
Ionize Friend
From: Germany
Registered: 2010-09-20
Posts: 397
Website

Re: [SOLVED] Filter and logical_date

Hmm, from the code I dont see the problem. Can you post your view file contents?


Webdeveloper, Programmer, Application developer, Ionize friend
@adaliszk

Offline

#5 2016-03-30 17:27:03

PGrafiek
Member
Registered: 2013-03-18
Posts: 24

Re: [SOLVED] Filter and logical_date

Here is the code :

<ion:page:articles all="true" filter="(article.logical_date).gt(CURRENT_DATE)" order_by="date ASC"  pagination="2">		
	<ion:article>
    	<p>
            <a href="<ion:url />"><ion:title tag="h3" /></a>
            <ion:date format="medium" />
		</p>   
	</ion:article>
</ion:page:articles>
<ion:page:articles:pagination pagination="2" />

The reason could be that i already use the TAG "<ion:page:articles>...</ion:page:articles>" elsewhere in the code ?

Thanks

Offline

#6 2016-03-31 10:43:33

PGrafiek
Member
Registered: 2013-03-18
Posts: 24

Re: [SOLVED] Filter and logical_date

Indeed, "Pagination" works fine with articles of the page, it's with the "Archives" where results are strange...
Thank you again for your help !

Offline

#7 2016-04-01 17:06:00

adaliszk
Ionize Friend
From: Germany
Registered: 2010-09-20
Posts: 397
Website

Re: [SOLVED] Filter and logical_date

Oh big_smile Your welcome.


Webdeveloper, Programmer, Application developer, Ionize friend
@adaliszk

Offline

What's Ionize ?

Ionize is an Open Source Content Management System created by webdesigners for webdesigners.

Created and maintained by Partikule and Toopixel, Ionize wants to be the easiest and most powerful CMS.

Can I help ?

Because talent is nothing without involvement, we are looking for motivated coders and webdesigners to join the project team.

Resources

Website : ionizecms.com
Documentation : doc.ionizecms.com

Development : Ionize on GitHub
Translations : Ionize Translations