Skip to content

Be able to have more contentBlock in template #404

@DblK

Description

@DblK

Hi,

I have the following usecase :

<template name="Component>
  <div class="head">
    {{> Template.contentBlock}}
  </div>
  <div class="content">
    {{> Template.elseBlock}}
  </div>
</template>

So now I can call the template like this:

{{#Component}}
  Part Head
{{else}}
  Part Content
{{/Component}}

So it's fine even if it's look "hacky" to use else block to provide two contentBlock.
In case I built something with more than two I can not use this trick.

I wish to be able to define multiple contentBlock in template and to call be able to specific which content for which contentBlock.

Example usage :

{{#Component}}
<templateBlock1>
  Part Head
</templateBlock1>
<templateBlock2>
  Part Content
</templateBlock2>
{{/Component}}

and for the definion:
```hbs
<template name="Component>
  <div class="head">
    {{> Template.contentBlock1}}
  </div>
  <div class="content">
    {{> Template.contentBlock2}}
  </div>
</template>

It should be like extending the Template.elseBlock to allow more than one.
The goal is to be able to build more flexible template.

Metadata

Metadata

Assignees

No one assigned

    Labels

    in-discussionWe are still discussing how to solve or implement it

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions