Markdown-card, icon, navigate

Hi,

Can someone help me out with some simple code, I have no clue how to find what I want to do.
I have a simple markdown card that displays an icon.

card:
  type: markdown
  content: |
    <ha-icon icon="fas:chevron-left"></ha-icon>

Now i want to add when you click/tap it it navigates to /lovelace/0.
How do I achieve this?

Thanks in advance!

you can’t do that with the markdown card. Why don’t you use the custom button card instead?

I see, I thought it was possible. Guess i will go the button-card road. :slight_smile:

After some more investigation I found some code i could make a small change to and made it work in a markdown card.

[<ha-icon icon=fas:chevron-left></ha-icon>](/lovelace/0)

You can also use html which give you some flexibility

  <a href="http://192.168.109.227:8123/lovelace/1">
      <img src="/local/pics/led-bulb_on.svg"  height="80" ></a>
  &nbsp;  &nbsp;  <a
  href="http://192.168.109.227:8123/lovelace/security_cameras">
      <img src="/local/pics/security-camera.svg"  height="95" ></a>  &nbsp;  &nbsp; &nbsp;  &nbsp; <a href="http://192.168.109.227:8123/lovelace/2">
      <img src="/local/pics/temperature.svg"  height="80" ></a>    &nbsp;  &nbsp;   &nbsp;  &nbsp;  <a href="http://192.168.109.227:8123/lovelace/alarm">
      <img src="/local/pics/alarm_off.svg"  height="80" ></a>

the &nbsp; adds spaces if you are using more than one icon you want to click on like this

image

Sweet, thanks, will remember that.

Ah, I had never thought about making it a link. I was thinking of ‘service calls’. Good idea.

could we extend this navigate and ‘fake’ it into a script service? Am searching for a way to add an X next to my list of persistent notifications to dismiss them:

code now is:

      content: >
        **{{state_attr('binary_sensor.rss_feeds','count')}} Rss feed notification{{'' if is_state_attr('binary_sensor.rss_feeds','count','1') else 's'}}:**
        {{'\n'}}{{'\n'}}
        {% for state in states.persistent_notification  %}
        {% if 'rss_feed' in state.entity_id %}
        {{'**' + state.attributes.message.split(',')[0] + ':**'}}
        {% set see = state.attributes.message.split('see ')[1]%}
        <font color = {% if 'gdacs' in see %}'green'
                      {% elif 'io' in see %}'blue'
                      {% else %}'red'
                      {% endif %}>
        {{state.attributes.title}}</font>{{'\n'}}
        See: {{ see }}
        {{'\n'}}{{'\n'}}
        {% endif %}
        {%- endfor %}

did you ever figure this out?

no, but we have ‘dismiss all’ now in the notification pane.

and I have a script doing the same just below that card in the frontend