Developer forum

Forum » CMS - Standard features » Item Publisher, filtering dates with querystring parameters

Item Publisher, filtering dates with querystring parameters

Aki Ruuskanen
Aki Ruuskanen
Reply

Hi,

I'm using the Item Publisher to publish News items and would like to have an Archive functionlity where user can click on a  month. 

How can I filter the items so that only the news items for a specific that month show up. 

I played around with the "Published.op" parameter. (http://doc.dynamicweb.com/documentation-9/content/apps/item-publisher#sideNavTitle1-2)

I was hoping that I could do someting like this : ?Published=2017-05-1&Published.op=>&Published=2017-05-31&Published.op=< to get items for "2017-05". But it does not seem to work that way.

Any ideas?

Regards / Aki

Replies

 
Nicolai Pedersen
Nicolai Pedersen
Reply

Well, do you have a field on the item called Published?

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Yes I do. 

If I write this "?Published=2017-05-15" I get the Item published that day. 

You mean that it shouldbe possible to combine multiple "Published.op" operators?

Regards / Aki

 
Nicolai Pedersen
Nicolai Pedersen
Reply

What I mean is - how does your item type look like? Does the item type has a field with the systemname "Published"?

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Yes it does. 

I can filter by that field with "?Published=2017-05-15" to get Items with that date. 

Regards / Aki

 
Morten Bengtson
Morten Bengtson
Reply
This post has been marked as an answer

Hi Aki,

If your item type has a "Published" date field and you want to filter the items by a specific date range then you can try the following query:

?Published.from=2017-05-01&Published.to=2017-05-31

Best regards,
Morten

Votes for this answer: 1
 
Aki Ruuskanen
Aki Ruuskanen
Reply

Alright. I'll try that. Thanks. 

/Aki

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Worked like a charm. yessmiley

The documentation for the ".from" and ".to" says it applies to "Number" fields. "Date" fields does not have those. An update perhaps. smiley

http://doc.dynamicweb.com/documentation-9/content/apps/item-publisher#sideNavTitle1-2

 

Regards / Aki

 
Carsten Boll
Carsten Boll
Reply

Fixed :)

 

You must be logged in to post in the forum