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

[Feature]: stat sheet: option for using conditional selection of values #4147

Closed
dwian opened this issue Jun 15, 2023 · 1 comment · Fixed by #4188
Closed

[Feature]: stat sheet: option for using conditional selection of values #4147

dwian opened this issue Jun 15, 2023 · 1 comment · Fixed by #4188
Assignees
Labels
feature Adding functionality that adds value

Comments

@dwian
Copy link

dwian commented Jun 15, 2023

Describe the Problem

When building a stat sheet, I want to have a nice layout, setting the values where I want them to be. handlebars only gives me {{#each properties}} to traverse through the array and put all values unseen in my html. I only can reject empty values or those marked as gmOnly.

Something like: here the attributes and over there all the token's abilities isn't possible.
What I would need is a further helper to compare a fixed value or string with a value from properties.

Example:
{{#each properties}}
{{#if (compare "STR" this.shortName) }}

{{#each properties}}
{{#if **(compare "STR" this.shortName)** }}
<p>{{name}}s strength is {{this.value}}</p>
{{else}} 
<p>{{name}}s a weakling. He has no strength </p>
{{/if}}
{{/each}}

The Solution you'd like

I'm not a programmer, even less a java programmer.
handlebars calls those hash-commands (like each or if) helpers. I can't say anything about quality or license inflictions but there is https://github.com/Knotx/
knotx-handlebars-extension.
The MatchHelper or StringEqualsHelper would really help.
If the order of the properties array is predictable the ElementHelper could be an alternative, maybe extended by a second parameter for the n-th value in the row. This could open some really dirty tricks like a value-Fiels for strength with basevalue, modifier, etc.

Alternatives that you've considered.

If this option isn't given, I will have to ignore the new stat sheet and use a frame5 instead.

Additional Context

No response

@dwian dwian added the feature Adding functionality that adds value label Jun 15, 2023
@dwian dwian changed the title [Feature]: [Feature]: stat sheet: option for using conditional selection of values Jun 16, 2023
@cwisniew
Copy link
Member

@dwian see #4185 for list of helpers that will be included in next pre release.
This should cover your requirement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Adding functionality that adds value
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants