Maybe I am a moron, but i just can't get this to work. Iv anyone can help me... please do so before i start hurting myself... :p I'm working with EE 2.5.5 and Matrix 2.5.2.
I've got a channel called "events". A matrix field assigned to "events" called "dates" (minimum rows = 0). "Dates" has 3 colums, a date column called 'date', a text column called 'city' and a P&T Switch called 'confirmed'.
Each entry has either no date (=no row), one date oder multiple dates. Each 'date' can of course be „in the future“ or „in the past“ since past events don't get deleted.
I'm trying to put out a list of all entries in this channel and ONE date (if conditions are met).
- If there is no date specified (=no row) in the matrix field: "no date specified"
- If there ARE entries for dates:
case 1: in the future, i need the next upcoming date
case 2: all dates in the past, i need "no date specified" again
I have tried everything i can think of but it seems i am not able to use if:else between my matrix tags...
My approach: Getting entries with no date is easy.
{if dates}
do something...
{if:else}
no dates found
{/if}
So far, so good. But when i try to do
{if dates}
{dates search:date=">{current_time}" sort="asc" limit="1"}
{if date}
{date format="%d.%m.%Y"} <!-- outputs next upcoming date if there is one -->
{if:else}
no date specified <!-- THIS does not work. Should get triggered when there
ARE rows in "dates" but all "date"-values are < current_time = already happened, -->
{/if}
{/dates}
{if:else}
no date specified <!-- no row -->
{/if}
Any suggestions? I've spent 4 hours trying everything i could think of... still getting nowhere....