meteor / meteor/blaze

Be able to have more contentBlock in template

Open
#404 2 comments 0 reactions 0 assignees View on GitHub
in-discussion
Dominant language
JavaScript
Stars
543
Forks
117
Avg merge
6h 18m
Merged PRs (30d)
2

Description

Hi,

I have the following usecase :
```hbs

{{> Template.contentBlock}}


{{> Template.elseBlock}}

```

So now I can call the `template` like this:
```hbs
{{#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 :
```hbs
{{#Component}}

Part Head

Part Content

{{/Component}}

and for the definion:
```hbs

{{> Template.contentBlock1}}


{{> Template.contentBlock2}}

```

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

Contributor guide

Open the contributing guide

Research direction

Start by tracing how Template.contentBlock and Template.elseBlock are implemented and how template blocks are parsed and rendered. Compare the current two-block behavior with the requested named contentBlock1 and contentBlock2 usage. Done means templates can define and render more than two distinct content blocks without using else.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.