Open jeremywillans opened 1 year ago
Similar functionality may be achieved by "cascading" templates & using yaml anchors:
template_1:
default: &ref_default
- var_1: ...
- var_2: ...
- ...
card:
...
...
template_2:
default: *ref_default
card:
...
- &ref_calling_template_1
type:custom:decluttering-card
template: template_1
variables:
- var_1: '[[var_1]]'
- var_2: '[[var_2]]'
...
...
template_3:
default:
... new default values
card:
... another functionality
- *ref_calling_template_1
... another functionality
Just to confirm, this approach would only work when using the yaml development method and not the UI, correct?
yaml-anchors are supported in yaml mode only.
Is your feature request related to a problem? Please describe. I have several fairly duplicated templates which have something minor as a difference, for example an extra service-data parameter or one with an extra option.
Describe the solution you'd like Is there a way to either inherit config from another template, or exclude parts of the template based on if you have specified the particular variable?
Describe alternatives you've considered Multiple templates