Hi everybody,
i do have a cell widget for my internet connection and I want to display the up/downstream in the footer.
Currently it looks like this:
Is it somehow possible to add a linebreak into the footer so that up and downstream are separated?
I’ve tried and \n without success
Here’s my code:
value: " "
config:
icon: oh:status
label: =items.WANConnectionDeviceFRITZBox7490_ConnectionStatus.state
color: blue
footer: ="Downstream:" + " " +
items.WANDeviceFRITZBox7490_MaxDownstreamRate.displayState + " / " +
"Upstream:" + " " + items.WANDeviceFRITZBox7490_MaxUpstreamRate.displayState
Sunny
(Sunny)
February 2, 2021, 12:11pm
2
I’m not sure how the footer is displayed but you could try an HTML breakline (’<br />
’) instead of the ‘\n’.
I’ve already tried but didn’t notice that the forum here will cut the HTML tags. In my original post it is here
But thanks so far - unfortunately it doesn’t work
AndyMB
(Andy)
February 2, 2021, 4:26pm
4
I’m no expert, but I can’t see a way to do this with the footer property. This appears to only accept a text string. You can do it with a custom widget:
component: f7-card
config:
title: '=(props.item) ? "State of " + props.item : "Set props to test!"'
content: Some content
style:
border-radius: var(--f7-card-expandable-border-radius)
box-shadow: var(--f7-card-expandable-box-shadow)
slots:
footer:
- component: f7-block
config:
style:
margin: 0px
padding: 0px
slots:
default:
- component: Label
config:
text: Lovely Spam! Wonderful Spam!
- component: Label
config:
text: Spa-a-a-a-a-a-a-am
With this you have access to the card slots , so you can specify more complex component based html.
So this is a potential workaround, if this does turn out not to be possible using the footer (card footer content) property.
2 Likes
Thanks a lot for the example. I think I might going for it if there’s not other chance.
In one of my other posts, I believe Yannick mentioned that he’s planning to expose header and footer in the OH widgets in such a way that you can configure via the slots. That would ease up creating custom widgets an still keep the openHAB style on those widgets.