{{#isNotEmpty}}

Checks if the given collection is not empty. Use it to output a list together with its wrapper markup, such as a heading or <ul>, only when the collection has items. The opposite check is isEmpty.

Syntax:

{{#isNotEmpty COLLECTION}}
If COLLECTION is not empty
{{else}}
If COLLECTION is empty
{{/isNotEmpty}}

Example:

{{#isNotEmpty tags}}
Tags list output
{{/isNotEmpty}}

Create your first website with Publii

Join thousands of creators who chose independence. Create content locally and publish lightning-fast, secure websites on your own terms.

Download Publii

Free and open source. Windows, macOS and Linux.

Read the getting started guide