I use “if” selections with articles anywhere and this works very well.
I would like to combine this with a comparison between a custom date field and the current day.
I suspect this can be done using Conditional Content, but I can't find a simple method, maybe possible with PHP conditions.
For example, I now use: {if selection="closed"}
and would like to add: "and selection-date > today"
With selection and selection-date are custom fields and today is the current date.
A tip if and how this is possible?
Thanks
Didier.
Hi Peter
Comparing by date seems to work well, also with multiple conditions. But combining AND and OR always seems to produce a true.
Works well:
{if dateswitch <= date('today') AND choicebefore="closed"}
However, always seems to produce a true:
{if dateswitch <= date('today') AND choicebefore="closed" OR dateswitch > date('today') AND choiceafter="closed" }
I expect AND to be processed first and then OR. Adding () does not help either.
Is this possible?
Thanks
Didier.
Thanks Peter, it's very nice that it works this way, just some repetitive code, easily via another Article Anywhere 😊
And another question: I now display today's day and date with some PHP code via Sourcerer, this works perfectly. But since Article Anywhere also uses this information, can't I just show today's day and date via an Article Anywhere call?