You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using handlebars in a framework that generates text from templates and data. I was wondering if it is possible to provide a function that that does the actual expression evaluation. For example, I'd like my users to be able to do the following:
{{#if answer.toLowerCase().includes("hi")}}
You said hi!
{{else}}
Please try again...
{{/if}}
Or
Your answer is {{answer.toLowerCase()}}
I know that the system supports helpers, so I could use that mechanism. But it would be nice if there could be a default helper that is always called even if no helper is specified in the template.
This discussion was converted from issue #1712 on December 03, 2021 21:07.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using handlebars in a framework that generates text from templates and data. I was wondering if it is possible to provide a function that that does the actual expression evaluation. For example, I'd like my users to be able to do the following:
Or
I know that the system supports helpers, so I could use that mechanism. But it would be nice if there could be a default helper that is always called even if no helper is specified in the template.
Is something like this possible?
Beta Was this translation helpful? Give feedback.
All reactions