Hi folks,
The instructions says to configure resource url to ā/local/layout-card.jsā but the HACS automatically registered it as ā/hacsfiles/lovelace-layout-card/layout-card.jsā and the layout-card.js is located at ā/config/www/lovelace-layout-card/layout-card.jsā
My problem is that the layout-card is not working and its reporting the following: Custom element doesnāt exist: layout-card
How I can configure it correctly at resources?
I feel stupid, but I just canāt get it to workā¦ Even simple copy/paste of one of very first cases from this post does not work for meā¦ I set up new view just for testing, made it panel view, added within this view just one layout-card and here is the code I use:
The only difference to sample code from previous posts is that I added column width, to show how much space is available for additional columns. Here is the result:
Whatever I try to do I end up with single column. I tried auto and horizontal layout - the same result. The only option that seems to help is to add min_columns and the number of displayed colums increaes to specified number, but again is not dynamic (it does not increase to 3 when enough space or not reduce to 1 in very narrow window.Iām on the latest version of card (just installed from HACS) and HA (0.109.6). Please help!
Since layout-card is a card in it self its area of effect will be limited to the width of a card, and thus you will (almost) always want to use it in panel mode:
Yeahā¦ I was playing with code in meantimeā¦ breaks were in the original post, in the one I pasted in second one I removed them, but in recent one I also changed layout to horizontal (BTW tested auto too)ā¦ but it didnāt helped either.
It makes me thinking if there is something fundamentally wrong with my installation/configuration. I started to play with layout-card, because I faced this very issue in my other views, where cards were not properly ordered, but aligned into single column. Though I linked it to use of custom stack cards, that apparently have issues with calculation of dimentions (as I read in some other post). So I wanted to force proper layout by moving my config to layout-card, but faced exaclty the same problem already during the test, without even moving more complex configurations into. So perhaps it is sort of āglobalā problem for meā¦
Your choices for column width and max_width fight against each other.
Hereās what layout card does with those instructions:
1: Start with 0 columns and 0% screen used.
2: Check if there are less than three columns. If not, finish.
3: Check if thereās room for one more column with width 100% of the screen. If not, finish.
4: Add a column that uses 100% the width of the screen. Set that column to render no wider than 250px.
5: Goto 2
Oh, I got my issue resolved! As expected stupid typoā¦ instead of dash I used underscore in column_widthā¦
Regarding selection of column-width and max_widthā¦well, once I corrected my typo it works as I expected! It simply limits width of cards inside column, so even if there is a space in view columns do not expand further neither create additional columnā¦ Perhaps being lucky
If you mean you went from column_width to column-width, then youāve made it invalid (it should an underscore), thereby removing the clash that Thomas explained in his post.
I am using layout-card with vertical layout and breaks to group my cards in to three different columns. As layout-card is used with panel: true, it is not possible to use badges in the view with layout card.
Are there any workarounds to use badges or achieve badge-like functionality with this setup? I was thinking of utilizing gap-cards and a card that displays the badge content, but if there are better ideas, Iām all ears.
you could put badges in a picture-elements card, āstate_badgeā I think. Then use card-mod to hide the picture elements background & borders.
If you want them all across the top of your view, then you could put the picture-elements card 1st with your current layout card 2nd in a card that will do a vertical stack such as nesting it in another layout-card, using stack-in-card (which removes the need for card-mod), or just a vertical-stack.
You could do the same layout with layout-card in grid mode but for this case, it might be simpler just to nest cards.
Then picture elements will be full width with your 3 columns of layout-card below.
not to be off topic in this thread, (and it wonāt solve your issue here) but since you posted:
thereās a typo in your stack-in-carD line.
also, since the custom card hui-element was introduced, there seems to be no more issue on ānon-existingā cards and the preloading isnāt required anymore.
@Marius you are perfectly right! I was fiddling in meantime with my whole UI configuration (after discovering benefits of layout-card) and as result I discarded completely preload_cards (but to be honest did not noticed typo ) and added hui-element instead wherever needed. Works perfectly now. I wish some of these functionalities are part of core rather than add onā¦ makes live so much easier!
Drawback of using layout card is that now whole view becomes single card, so there is a lot to be displayed in UI editor and it is just not capable of dealing with such amount of informaiton (my biggest view have now ~1100 lines of code and browser is constantly refreshing preview part and quite frequently crashing and reloading page).
Thank you, I used your solution and now it works perfectly!
As picture-elements requires a image background, it took some time to find a suitable sized transparent image. In the end, I used a self-hosted 25x1 transparent image. If it was wider, the height of the card would become too small and it would cut out. If it was too narrow, the card height would become too big.
My config is starting to become confusing, as my card layers are the following. Letās hope that I donāt need to go a lot deeper
vertical-stack
conditional
picture-elements (for "badge")
layout-card
other cards (my main UI)
Lol, I do each thing bit, by bit. Fixing each āissueā as I come across it. Sometimes I look at the end result and think, Iāve no idea how I got there!
Can`t get scrollbar go away on the side? Can someone put me in the right direction to hide it or to get the max height from a device and only show scrollbar on mobile devices?
Tried different setups with different grid settings but scrollbar stays whatever i try: