--- title: "Liquid tags: if" description: Renders an expression if a specific condition is `true`. api_name: liquid source_url: html: https://shopify.dev/docs/api/liquid/tags/if md: https://shopify.dev/docs/api/liquid/tags/if.md --- # if Renders an expression if a specific condition is `true`. ## Syntax ```oobleckTag {% if condition %} expression {% endif %} ``` condition The condition to evaluate. expression The expression to render if the condition is met. ```liquid {% if product.compare_at_price > product.price %} This product is on sale! {% endif %} ``` ## Output ```html This product is on sale! ``` ### elsif You can use the `elsif` tag to check for multiple conditions. ```liquid {% if product.type == 'Love' %} This is a love potion! {% elsif product.type == 'Health' %} This is a health potion! {% endif %} ``` ## Output ```html This is a health potion! ```