Hello!
is it possible to compare a field not to a given value but to another field in a view?
Something link this:
Date: [firstday][if firstday not_equal lastday] until [lastday][/if firstday]
I tried it but it didn't work.
Thanks!
Jan
Though I'm not sure what your use case is, it seems like you want to take advantage of the multiple conditionals as seen here. Instead of the hardocded values in the example, you can use the shortcode for the other field(s).
Hi Rob!
Thanks for multiple conditions. That's not what I need - but good to know.
I need the second thing: Not hardcode the values but using shortcode instead.
When I enter the shortcode for the field I want to compare with, I get the following code.
For better reading I replaces the IDs with the field names - but it does not work either.
I list events which last one or multiple days. If they only last one day i want to print "Date: d.m.Y" and if the last longer I want to print "Date: d.m.Y until d.m.Y". (German date format.)
This is the code I'm using for this:
Date: [firstday format="d.m.Y"][if firstday not_equal="[lastday]"] until [lastday format="d.m.Y"][/if firstday]
It's output is always like this - no matter if the fields are equal or not:
Date: 26.02.2023″] until 28.02.2023
So the IF statement seems to be broken. But I don't see any syntax error there.
Jan
Please login or Register to submit your answer