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.

Possibility to include elements in addition to cards?

See original GitHub issue

Is your feature request related to a problem? Please describe. I’ve been struggling with the following scenario:

I’m working on my floor plan, where I’m wrapping a Picture Elements card inside your config template card. This far, everything works great.

But, somewhere down the tree of image elements inside the picture elements card, I’m using the decluttering card, to be able to reuse the same config for a bunch of lights for example. This decluttering card has it’s config in another file, and the decluttering card has the ability to add an image element to it.

The problem I’m facing is that I’m trying to do quite a large portion of logic with the help of your card, but since the decluttering part is in another file, it seems I’ve lost the scope of the config template card.

Describe the solution you’d like In a dream scenario, I would in the separate decluttering card file be able to have the following structure (edit: have tried getting the correct line breaks to work without luck, but I hope you see what I’m after. Linebreak/indendation after every colon):

decluttering-card: card: custom:config-template-card element: type: image

…but since I can’t add an image element to your card, this can’t be done it seems. I think this would be a good additon to your card and make it easier for people to maintain structured and maintainable code with much flexibility.

Describe alternatives you’ve considered I’ve thought about moving the javascript logic to the “main” card and inject the result as variables into the decluttering card, but that would mean I’d have to rewrite the same logic for every decluttering card and it will be quite a few (since I haven’t found a way to create a global function or something in your card to be able to reuse the same logic across all decluttering card instances). This doesn’t seem efficient

I’ve tried using Yaml/Jinja inside the decluttering card, but I’m much more used to javascript and I’ve spent two days not being able to extract different values needed. Probably due to some linebreak/whitespace/indentation or something similar that YAML likes to complain about. Problem is, I’m not getting any console errors whatsoever, so this option I’d like to throw in the bin for now.

Additional context I’ve tried being as clear as I can, but please let me know if I can provide any more information or clear things up for you!

I really like using your card and it has saved me a lot of hair I would otherwise have pulled out by now.

// Jens.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
iantrichcommented, Nov 7, 2020

Yeah I think it will be pretty straight forward. Thanks for the PR

1reaction
jenseocommented, Nov 7, 2020

Pull request created:

#50

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cards - Inclusive Components
Let's imagine a basic card. It has an illustration, a 'title', a description, and an attribution. Importantly, it belongs to a list item...
Read more >
Cards: UI-Component Definition - Nielsen Norman Group
A “card” is a UI design pattern that groups related information in a flexible-size container visually resembling a playing card.
Read more >
Payment Element and Card Element comparison - Stripe
Learn more about the Payment Element and Card Element so you can decide which to use in your integration. Previously, each payment method...
Read more >
Cards - Material Design
Cards use a container transform transition pattern to reveal additional content. ... Avoid extending UI elements across the screen whenever possible.
Read more >
Cards - Bootstrap
A card is a flexible and extensible content container. It includes options for headers and footers, a wide variety of content, contextual background...
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