Skip to content

Have different ways of getting a variable #14

@miketamis

Description

@miketamis

From @miketamis on November 24, 2018 0:40

We need more ways of getting variables ie applying transforms but also just different forms.

I have done this in a hack y way at the moment with HTL language, if you have a morph file like

<js>
    const properties = { myVar: "world" }
</js>

<example.htl>
<div>hello ${properties.myVar}</div>
</example.htl>

you can use example as a variable and you would get

<div>hello world</div>

but what if you wanted the HTL its self ie your deploying it to AEM or doing some other sort of proccessing on the raw code.

currently you can do example_raw and it will give you

<div>hello ${properties.myVar}</div>

I personally don't like having foo_raw one this means that if you create a variable with _raw at the end its confusing but two its just not obvious that its a transformation.

maybe instead a syntax like

// current
${ example_raw }

//ideas
${ example @raw }
${ example#raw }
${ raw`example` }
${ raw^example }

im very much open to other ideas and votes.

Copied from original issue: miketamis/morph-extension#14

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