Hello,
I have many Markdown cards with some code. Now I have the problem that if the code is empty at the end, a small box is still displayed.
Is it possible that if the code is empty at the end (all If queries are false), then no box will be displayed?
For example I have this Code:
type: markdown
content: >-
{% set x = expand( 'media_player.wohnzimmer', 'media_player.schlafzimmer',
'media_player.bad', 'media_player.buro', 'media_player.kuche',
'media_player.buro_2',
)
| selectattr('state', 'eq', 'playing')
| map(attribute='name') | list %}
{{ '***
# Audio' if x | length > 0 else '' }}
{% if is_state('media_player.wohnzimmer', 'playing') %} ## <font
color="#ff7c00"><ha-icon icon="mdi:speaker"></ha-icon></font> OG Wohnzimmer {%
else %}{% endif %}
{% if is_state('media_player.schlafzimmer', 'playing') %} ## <font
color="#ff7c00"><ha-icon icon="mdi:speaker"></ha-icon></font> OG Schlafzimmer
{% else %}{% endif %}
{% if is_state('media_player.bad', 'playing') %} ## <font
color="#ff7c00"><ha-icon icon="mdi:speaker"></ha-icon></font> OG Bad {% else
%}{% endif %}
{% if is_state('media_player.buro', 'playing') %} ## <font
color="#ff7c00"><ha-icon icon="mdi:speaker"></ha-icon></font> OG Büro {% else
%}{% endif %}
{% if is_state('media_player.kuche', 'playing') %} ## <font
color="#ff7c00"><ha-icon icon="mdi:speaker"></ha-icon></font> EG Küche {% else
%}{% endif %}
{% if is_state('media_player.buro_2', 'playing') %} ## <font
color="#ff7c00"><ha-icon icon="mdi:speaker"></ha-icon></font> EG Büro {% else
%}{% endif %}