Skip to content

[FR]: Pass object variables in JSON format when used in templates #83

@erkr

Description

@erkr

Hi code owners

Updated to a FR, 8 June 2024:
Decluttering card is really a great project. I recently discovered it and I love it 😊

I noticed that we can pass both object and strings as variables. Directly assign object variables (e.g list) to a key in the card works. I'm stuck passing object variables and use them in templates.

I either get a string that contains [[undefined]], [[variable name]] or the default value 'xxx' declared as a string.

I tried this markdown card template:

  decl_test_var:
    default:
      - VALUE: xxx
    card:
      type: markdown
      content: "{{ '[[VALUE]]' }}"

With this card:

type: custom:decluttering-card
template: decl_test_var
variables:
  - VALUE:
      - tst1.x
      - tst2.y

That doesn't work. There seems no way to pass the object variables into a template

FR: Please pass object variables as a json string when applied inside a template. A special marker like this would be fine:

content: "{{ '[[VALUE:JSON]]' }}"

Thanks in advance
Eric

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions