Is there a way to display a short text based on the date or even month?
This would be similar to the Fortune plugin, but not random.
Solved by Justin Young View solution
Is there a way to display a short text based on the date or even month?
This would be similar to the Fortune plugin, but not random.
Here's a solution
{% set message = { "01": 'foo', "02": 'bar' } %} {# each date has a message #}
{% set date = now | date("d") %}
{{ message[date]|default('no data for given day') }}
Nice! Also very useable for weekday messages via changing "d" to "D" and altering the array to elements like
"Mon": 'Go for it! A new week has begun!'
Log in to reply.
| Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| 2 | 83 | 2 days ago | ||
| 0 | 147 | 7 days ago | ||
| 0 | 146 | 1 week ago | ||
| 0 | 142 | 1 week ago | ||
| 2 | 226 | 2 weeks ago |