{{#checkIf}} helper

An extended version of the #if block helper with support for operators. Useful if you need to compare two arguments in a non-standard way.

Supported operators:

  • '==',
  • '!=',
  • '===',
  • '!==',
  • '&&',
  • '||',
  • '<',
  • '<=',
  • '>',
  • '>='


{{#checkIf ARG_1 OPERATOR ARG_2}}
Code displayed when above condition is true
Code displayed when above condition is false


You can use:

{{#checkIf author '&&' author.avatar}}
    <img src="{{author.avatar}}" alt="" />

Instead of:

{{#if author}}
    {{#if author.avatar}}
        <img src="{{author.avatar}}" alt="" />

We can also find out if we are in a particular post by ID; eg. add a code just for the post with ID=10

   {{#checkIf id '==' 10}}
         your code here...


Get the latest Publii news, updates and more delivered directly to your email inbox

You can change your mind at any time by clicking the unsubscribe link in the footer of any email you receive from us, or by contacting us at By clicking below, you agree that we may process your information in accordance with our Privacy Policy.