Skip to content

Conditional attributes cause duplication of template code #24

@line-o

Description

@line-o

Consider an element that needs to have an attribute set when a certain configuration value is set (non-empty).
So, attribute test should only be set if $config?test is anything else but the empty sequence.
Currently this is only possible way do express this is by writing

[% if (empty( $config?test )) %]
<my-element />
[% else %]
<my-element test="[[ $config?test ]]"/>
[% endif %]

When we now have two or more of those conditional attrbutes the element template has to be duplicated for each possible combination of those flags.
This is not feasible and error prone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions