Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
KK,

I am trying to make it so I can show events on a page using the criteria of start_date to show them.

The problem I am having is I want to show by month.

I created an additional field in the template to choose month, but would like to get rid of that field and just use the start_date.

This is what I have now.
Code: Select all
<cms:pages masterpage='sale_template.php' show_future_entries='1' limit='10' paginate='1' custom_field="sale_month==November | status!==archive" order='asc' orderby='start_date'>


This is what I would like to happen.

Code: Select all
<cms:pages masterpage='sale_template.php' show_future_entries='1' limit='10' paginate='1' custom_field="start_date==November | status!==archive" order='asc' orderby='start_date'>


The problem is the month is not stored as November, it is stored as the usual yyyy-mm-dd

So is there a way to do something like:

custom_field="start_date = <cms:date start_date format='F' />==November | status!==archive"

I know that's not right, but it helps show what I'm trying to do.
Also here is the editable input field that corresponds.

Code: Select all
 <cms:editable 
      name='start_date'
      label='Start Date'
      height='60'
      required='1'
      type='datetime'
      months='January, February, March, April, May, June, July, August, September, October, November, December' />
Hi Shuff19,

May I suggest taking a look at the <cms:archives tag, I believe you'd be able to achieve your desired output through use of this tag.

Please see: http://www.couchcms.com/docs/concepts/u ... hives.html for more info
Image
I did a lot of searching the forums, I guess I didn't do enough :roll:

I found my solution in this post. http://www.couchcms.com/forum/viewtopic.php?f=8&t=7126&p=9537&hilit=datetime#p9537

Basically instead of using:
Code: Select all
custom_field="start_month==November


I used

Code: Select all
custom_field='start_date>=2014-11-01 | start_date<2014-12-01


It was KK's answer of course! :)
4 posts Page 1 of 1