N
Novuβ€’10mo ago
Shaun

Greater Than and Less Than Helper

Hi there πŸ™‚ I'd like to include a certain text string if the step.count is greater than a specified count. This will be used when aggregating notifications so we list a preview of the first 5 and then include something expressing there are more items at the end. I imagine something like
{{#if (step.total_count > 5)}}
GREATER THAN TEXT
{{/if}}
{{#if (step.total_count > 5)}}
GREATER THAN TEXT
{{/if}}
or even a specific helper {{#gt step.total_count 5}} could work. It looks like this is not a supported case but I was curious if there was any plans to support this case. I saw a previous support post in 2022 where they implied a GitHub issue would be opened but no luck finding it. Thank you!
8 Replies
Novu_Bot
Novu_Botβ€’10mo ago
@Shaun, you just advanced to level 2!
Pawan Jain
Pawan Jainβ€’10mo ago
@Shaun Thanks for sharing the request and linking the previous support post. We have not yet added this helper. I could not find an issue for the same Can you please help us in creating a feature request on github for this? !feature
Shaun
ShaunOPβ€’10mo ago
Hi @Pawan Jain ! Unfortunately my corporate GitHub doesn't seem to allow me to create issues in external repos. Would you be able to make a feature request for me or I can look into another way to contribute?
Pawan Jain
Pawan Jainβ€’10mo ago
Yeah sure Shaun πŸ™‚ I will create an issue and share in this thread
Pawan Jain
Pawan Jainβ€’10mo ago
GitHub
πŸš€ Feature: support of Comparison operators handler helpers Β· Issue ...
πŸ”– Feature description Comparison operators β€” operators that compare values and return true or false. The operators include: >, <, >=, <=, ===, and !==. Example:- {{#gt step.total_count ...
Shaun
ShaunOPβ€’10mo ago
Thank you! Also just throwing this reference I found around adding comparison operators in handlebars: https://nicholasgraffis.medium.com/using-conditional-logic-in-handlebars-dd0942cb3a79
Medium
Using conditional logic in handlebars
We have {{#if}} and {{#unless}}, but how can we expand on this for easier and more advanced logic inside our handlebars templates? πŸ€”
Want results from more Discord servers?
Add your server