Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chained else expression #12

Closed
sunng87 opened this issue Feb 12, 2015 · 13 comments
Closed

Chained else expression #12

sunng87 opened this issue Feb 12, 2015 · 13 comments

Comments

@sunng87
Copy link
Owner

sunng87 commented Feb 12, 2015

Support syntax

{{#if ...}}
{{else if ...}}
{{else}}
{{/if}}

handlebars-lang/handlebars.js#892

@sunng87 sunng87 mentioned this issue Feb 12, 2015
@sunng87 sunng87 added the syntax label Feb 24, 2016
JoNil pushed a commit to JoNil/handlebars-rust that referenced this issue Mar 19, 2016
@golddranks
Copy link

Is there any workaround currently? I'd like to use this, but unfortunately I'm currently too busy to contribute.

@golddranks
Copy link

golddranks commented Dec 13, 2016

Oops the obvious workaround works. I had an unrelated syntax error because of a typo, which made me think that nesting wouldn't work.

{{#if var1}}
    ...
{{ else }}{{#if var2}}
    ...
{{ else }}
    ...
{{/if}}{{/if}}

@sunng87
Copy link
Owner Author

sunng87 commented Dec 14, 2016

Yes.

To support chained else, we may need an update in current parser and helper definition because {{else if ...}} is incompatible with current model.

@rousan
Copy link

rousan commented Apr 21, 2020

Hey @sunng87, any progress on this issue?

@sunng87
Copy link
Owner Author

sunng87 commented Apr 21, 2020

@rousan sorry, there is no progress for now.

@rousan
Copy link

rousan commented Apr 21, 2020

so, is there any way to add some patches like adding a block helper? It would very helpful then.

@sunng87
Copy link
Owner Author

sunng87 commented Apr 22, 2020

@rousan the helper system is totally open. You can register you own block/inline helpers with our API. Checkout examples if you like.

For this chained else, some work needs to be done on the parser and our template structure to support chained inverse template segment. I will probably add support in future releases.

@shujaatak
Copy link

@rousan the helper system is totally open. You can register you own block/inline helpers with our API. Checkout examples if you like.

For this chained else, some work needs to be done on the parser and our template structure to support chained inverse template segment. I will probably add support in future releases.

Anxiously waiting for this feature!
Any updates?

@sunng87
Copy link
Owner Author

sunng87 commented Nov 30, 2021

@shujaatak Unfortunately there is no progress for this feature. Contributions are welcomed for this.

@jqiris
Copy link

jqiris commented Jan 16, 2024

Any updates?

@sunng87
Copy link
Owner Author

sunng87 commented Jan 16, 2024

Fixed in #629

@sunng87 sunng87 closed this as completed Jan 16, 2024
@jqiris
Copy link

jqiris commented Jan 16, 2024

https://crates.io/crates/handlebars version not change?

@sunng87
Copy link
Owner Author

sunng87 commented Jan 17, 2024

Released in 5.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants