The most obvious approach is to use a conditional expression. In this example, we set the variable holiday
so we don't have to write the same filter twice, but you could also use a function, or simply run it twice (it won't be much slower, just uglier):
<$let
formattedToday=<<now "0MM/0DD">>
holiday={{{ [[UsHolidays]getindex<formattedToday>] }}}
>
<% if [<holiday>!is[blank]] %>
It's ''<<holiday>>'' today!
<% else %>
Sadly, it's a very ordinary day today.
<% endif %>
</$let>
Sadly, it's a very ordinary day today.
However, a more concise approach is to use the $list
widget with the emptyMessage
parameter, which is rendered if the filter returns no results:
<$list filter="""[[UsHolidays]getindex<now "0MM/0DD">]""" emptyMessage="Sadly, it's a very ordinary day today.">
It's ''<<currentTiddler>>'' today!
</$list>
Sadly, it's a very ordinary day today.