How to add icon to secondary information field
See original GitHub issueCurrent 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:
- Created a year ago
- Comments:10 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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.