From: David Luhr Date: Thu, 8 Jun 2017 17:24:36 +0000 (-0600) Subject: Add else statement inside of ifequal example X-Git-Tag: v6.4.0~1^2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F10156%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Add else statement inside of ifequal example 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. --- diff --git a/docs/pages/panini.md b/docs/pages/panini.md index 3d6a03b82..696b0a2aa 100644 --- a/docs/pages/panini.md +++ b/docs/pages/panini.md @@ -126,6 +126,8 @@ Displays the HTML inside the helper if the two values are equal. ```handlebars {{#ifequal foo bar}}

foo and bar are equal

+{{else}} +

foo and bar are not equal}} {{/ifequal}} ```