I found this template for a welcome message in my mushroom dashboard;
#Welcome template:
{% set time = now().hour %}
{% if (time >= 18) %}
Good Evening, {{user}}!
{% elif (time >= 12) %}
Good Afternoon, {{user}}!
{% elif (time >= 5) %}
Good Morning, {{user}}!
{% else %}
Hello, {{user}}!
{% endif %}
I want to add if user is ‘mrX’ then write ‘hello little x!’
else just write the username as in the template above implies.
But I am not a programmer and I don’t know YAML so can anyone show me how to do this possibly quite easy trick?
It would mean a lot and help me understand the programming of yaml.
Thanks!
Good question. Ideally no. I would want the good afternoon etc. to stay and have just the {{user}} be replaced with a nickname if the user is that certain user.
Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions.