I have a section of 'deals/coupons' with custom startDate and endDate. These are needed so the client can load up a bunch of deals but only have them render to the page when a particular deal is 'active'.
The below syntax works to not show any deal before it's startdate has passed:
{% paginate craft.entries({
section : 'dealDirectory',
limit : pageSize,
startDate : '<=' ~ now
}) as pageInfo, dealEntries %}
And using the below code I can prevent deals from showing after their enddate but only if enddate has data:
{% paginate craft.entries({
section : 'dealDirectory',
limit : pageSize,
startDate : '<=' ~ now
endDate : '>=' ~ now
}) as pageInfo, dealEntries %}
If enddate does not have a value it eliminates those entries from showing. I need to find a way to check if enddate is greater than now OR is null so that it will continue to show deals that do not have an enddate. Such as:
{% paginate craft.entries({
section : 'dealDirectory',
limit : pageSize,
startDate : '<=' ~ now
endDate : '>= ' ~ now ~ 'or is null' // but this syntax incorrect
}) as pageInfo, dealEntries %}
I'm having a hard time finding a reference for this type of markup.