diff --git a/_filters/default.md b/_filters/default.md index 5366cb4..552fa5d 100644 --- a/_filters/default.md +++ b/_filters/default.md @@ -50,3 +50,21 @@ In this example, `product_price` is empty, so the default value is used. {% assign product_price = "" %} {{ product_price | default: 2.99 }} ``` + +### Allowing `false` {%- include version-badge.html version="5.0.0" %} + +To allow variables to return `false` instead of the default value, you can use the `allow_false` parameter. + +

Input

+```liquid +{% raw %} +{% assign display_price = false %} +{{ display_price | default: true, allow_false: true }} +{% endraw %} +``` + +

Output

+```text + +false +```