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

Expand helper js to include ifor and ifand #2021

Closed
guywillis opened this issue Mar 22, 2018 · 0 comments · Fixed by #2022
Closed

Expand helper js to include ifor and ifand #2021

guywillis opened this issue Mar 22, 2018 · 0 comments · Fixed by #2022

Comments

@guywillis
Copy link
Contributor

guywillis commented Mar 22, 2018

Update the core helper js to include ifor and ifand statements.

Example of ifor use:
Only render the header section of an article / block / component when either the displayTitle, body, or instruction is present.

{{#any displayTitle body instruction}}
<div class="component__header {{_component}}__header">
</div>
{{/any}}

Example of ifand use:
Only render the header section of an article / block / component when the displayTitle, body, and instruction are all present.

{{#all displayTitle body instruction}}
<div class="component__header {{_component}}__header">
</div>
{{/all}}

Example of ifand ifor use:

{{#all (any displayTitle title) body instruction}}
<div class="component__header {{_component}}__header">
</div>
{{/all}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant