Content Views Pro helps you to filter content by a custom field easily. Here is a sample to filter upcoming events:
To filter by a custom field, in “Filter Settings” tab, select the Custom Fields checkbox. In the “Filter by Custom Fields” box, click “Add New” button, then:
- select the name of custom field for “Field Key”
- select the “Value Type” of the field. Available options are:
- Date Time
- select option to compare in “Operator To Compare” setting. There are many options which work for all your needs:
- Now & Past
- Now & Future
- In the past
- Equal ( = )
- Differ ( != )
- Greater ( > )
- Greater or Equal ( >= )
- Less ( < )
- Less or Equal ( <= )
- Not Exists
- select the value for “Value To Compare” if needed. Some of above options don’t require value.
With Content Views Pro version 188.8.131.52 and before, filter by a date custom field only supports field which has value in YYYY-MM-DD (year-month-date) format.
If the field doesn’t has that format, you will need to create an alias field.
Assuming you have some events, each event has a custom field “Start Date”. Value of these custom fields are somethings like 10 Sep 2015, 9 Oct 2015…
Because value of this field is not in format YYYY-MM-DD, we have to create a new custom field (read more here):
– give it a custom name (for example: cvp_start_date)
– convert value of the field “Start Date” to YYYY-MM-DD format, to set as value of this field. For example, the value of “Start Date” is “10 Sep 2015”, so value of the alias field is “2015-09-10”.