Forum for discussing general topics related to Couch.
5 posts Page 1 of 1
I have a page with a list of news item. Each news item is accompanied by a date tag:

<cms:editable name='blog_date' type='datetime' format='mdy' required='1'/>

This is displayed on the website as:

<p class="sub"><cms:date blog_date format='jS M, Y' /></p>

I want to archive all news items based on the user input date and not on the date of creation of the news item. For instance, a news item listed as April 2012 created on Oct 2014 is archived under Oct 2014 and not April 2012. How do I change this behavior?
Hi,
I want to archive all news items based on the user input date and not on the date of creation of the news item.
Out of the box, I am sorry, archives will work only with the system publish-date (and not with a custom field, as you desire).

That said, may I ask what are you using the publish-date (creation date) for? Is is unused, as now the custom field seems to be doing its job, or you are using it for some other purpose?

Thanks.
I am not using the creation date at all. The user enters a date through the blog_date which is CMS editable type date. Can this date be used to group archive based on the year entered by the user?I did not get your question regarding "creation date". I only want to use the custom date to grup archive.
Sorry if I came across as vague.

Sarah, while editing/creating any page, if you click the 'Advanced setting' button (on top right) you'll get a date input field where you can set the publish-date for the page.

This system field is used by Couch to order the pages when shown in a list in admin-panel, can be used with cms:pages (as 'start_on' and 'stop_before' parameters) to constrain the listing to a particular time period, is used by cms:archives tag to group pages the way you desire and so on.

On the front end you can display it as
Code: Select all
<cms:date k_page_date format='jS M, Y' />

You should ideally use this field (instead of creating a redundant custom field) for setting the dates as it can be used for so much more than plain display.
Exactly what I was looking for. Thanks!
5 posts Page 1 of 1
cron