adobe / adobe/htl-spec

Support content projection in data-sly-template

Open
#67 6 comments 2 reactions 1 assignee Claimed by @raducotescu View on GitHub
Dominant language
No language data
Stars
288
Forks
142
PR merge metrics
No merged PRs in 30d

Description

In Angular and a multitude of other templating languages, it is possible to declare slots where templates can hold injected html, this is known as content projection, it is a method in which layout and content of layout are separated. This means that a template becomes extremely flexible and quick to refactor. I have found a very hacky way to do this currently (not practical in prod).

**The workaround**:
```



${FormInputSlot1 @context="html"}


${FormInputSlot2 @context="html"}

```
**This is less than ideal for several reasons**
• Escaped quotes
• Markup as a string
• Involved setup
• No ability to have slot contents imported from files

**I propose that the functionality could look like this:**
```










creates a slot to inject content



creates a slot to inject content

varient



`
```
I'd love to hear your thoughts.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.