Ton van Loon
I want to select/filter all the featured articles of category 11 and its child-categories that meet all off the below conditions or that have status=2 (
because status 0 means that dates need to be evaluated, status 2 is the override for the date-evaluation.)
Conditions:
- status=0
- datum-eerste-uitvoering < NOW + 8 days
- datum-laatste-uitvoering > NOW - 1 days
-
environment: J4.0.3, articles anywhere 11.1.1PRO-dev2165300
Outcome
I've tried these two code-samples but all samples only show articles that have status = 2, and no articles that meet the mentioned conditions. (Filtering on featured articles off category=11 with children works well)
Who can help me?
- sample 1{articles category:id="11" include-child-categories="true" featured="true"
status="0" && datum-eerste-uitvoering="<date('+8 days')" && datum-laatste-uitvoering=">date('-1 days')" || status="2"}
[title] {/articles}
- sample 2{articles category:id="11" include-child-categories="true" featured="true"
status="2" || status="0" && datum-eerste-uitvoering="<date('+8 days')" && datum-laatste-uitvoering=">date('-1 days')"}
[title] {/articles}
Narrowing down my problem
Filtering all the featured articles of category 11 and its child-categories that meet only the conditions above conditions (so dropping the optional status=2) does not give any return. For this I tried the code samples 5 and 6.
- sample 3{articles category:id="11" include-child-categories="true" featured="true"
status="0" && datum-eerste-uitvoering="<date('+8 days')" && datum-laatste-uitvoering=">date('-1 days')"}
[title] {/articles}
So my problem must be in the date-conditions. The date conditions of code-sample 3
do work perfectly within an {if}-statement (with slightly different syntax on the date-evaluation according to the documentation):
{if status=0 && datum-eerste-uitvoering < date('+8 days') && datum-laatste-uitvoering > date('-1 days')} [some-code]{/if}
What am I overseeing?