]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Add else statement inside of ifequal example 10156/head
authorDavid Luhr <davidc.luhr@gmail.com>
Thu, 8 Jun 2017 17:24:36 +0000 (11:24 -0600)
committerGitHub <noreply@github.com>
Thu, 8 Jun 2017 17:24:36 +0000 (11:24 -0600)
It is unclear that else statements are possible inside of {{#ifequal}} helpers to show HTML if the two values are not equal. Because there are {{#ifpage}} and {{#unlesspage}} as separate equal/not equal helpers, users may be confused that there is no equivalent "unlessequal" helper or "!" syntax.

I have successfully used the {{else}} Handlebars helper inside if the {{#ifequal}} Paini helper to achieve the desired "not equal" condition, but only thought to try this as a guess after a lot of unsuccessful searching through documentation on both Handlebars and Panini.

docs/pages/panini.md

index 3d6a03b8215f5bd9d495791d011350bcd322a8cb..696b0a2aa7517186b21924cbcb0420f46ce2a324 100644 (file)
@@ -126,6 +126,8 @@ Displays the HTML inside the helper if the two values are equal.
 ```handlebars
 {{#ifequal foo bar}}
   <p>foo and bar are equal</p>
+{{else}}
+  <p>foo and bar are not equal}}  
 {{/ifequal}}
 ```