question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to add icon to secondary information field

See original GitHub issue

Current Behavior

This is not really a bug but rather a question and I did not find a better place where to post it:

I use a template card on my dashboard.

I use the following code to display the number of open windows on that card as secondary information:

{%set state=states(‘sensor.office_open_windows’)%}{% if state | int >= 1 %} W: {{ state }}{% else %}{% endif %} So if e.g. one window is open it displays “W: 1”. So far so good. However it would look cooler if instead of the W I could display a mdi:window-open icon in front of the counter.

I tried adding mdi:window-open in various ways but I could not get it to work. Btw. I am happy with a static icon, does not have to be dynamic.

Expected Behavior

No response

Steps To Reproduce

No response

Environment

- OS:
- Node:
- Version:
- Hassio:

Anything else?

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
hesspointcommented, May 19, 2022

Screen Shot 2022-05-19 at 21 43 47

I used the window one and the plant. so if at least one window/door in that room is open and/or at least one plant low on water it will show the icon with the number of affected entities.

1reaction
hesspointcommented, May 21, 2022

I simply did a linebreak in the secondar information field. Every new line in the code is also a new line in the UI. So if you have e.g an if else statement you need to write it all in one line. If you break it into multiple lines as I normally would it will create a bunch of blank lines.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Adding Extra Fields and Icons to The Top Header | Quiroz.co
2. Now the first thing you are going to do is create a secondary menu. Go to Appearance > Menus, Select “create new...
Read more >
WordPress Menu Icons Tutorial: How to Add Them to Your ...
Locate the Icon: Select link. Click on that to navigate to the section to add an icon to that particular menu item. select....
Read more >
How to Add Image Icons With Navigation ... - WPBeginner
After that, scroll down and click on any menu item to expand its settings. You'll notice a 'CSS Classes (Optional)' field where you...
Read more >
Adding Icons to Menu Items - GeneratePress documentation
If you expand the menu item you wish to add the icon to by clicking the down arrow, you'll see some fields appear....
Read more >
How To Add Icons To The Divi Menu - YouTube
In this tutorial I will show you how to add icons to the Divi Theme Builder Menu module, in the main menu, the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found