Welcome to G5 Help Center

G5 Knowledge Base
G5 Logo Knowledge Base

Return To Blog

Core: Using Liquids

Introduction

This document explains how to use liquid code on Core websites to perform such tasks as hiding or replacing content on a shared page, or creating custom email recipient lists for forms.

 

Replace Content on a Shared Page

Scenario: client has a shared page used by multiple locations, but one location wants to replace content in Paragraph Two of the three paragraphs displayed on that page:

  1. Add a custom value to the applicable location: Name = replace_content (can use any word, but multiple words must be separated by underscores); Value = the new content

  2. Add the following liquid code to the page; notice that the first line of liquid code precedes the content to be replaced and the second line of liquid code follows the content to be replaced

Paragraph One.

{% if !store.replace_content %} {{ store.replace_content }} {% else %}  

Paragraph Two.

{% endif %}

Paragraph Three.

 

Hide Content on a Shared Page

Scenario: client has a shared page used by multiple locations, but one location wants to hide Paragraph Two of the three paragraphs displayed on that page:

  1. Add a custom value to the applicable location: Name = hide_content (can use any word, but multiple words must be separated by underscores); Value = hide (can use any word or words)

  2. Add the following liquid code to the page; notice that the first line of liquid code precedes the content to be hidden and the second line of liquid code follows the content to be hidden

Paragraph One.

{% if !store.hide_content %} {{ != empty }} {% else %}

Paragraph Two.

{% endif %}

Paragraph Three.

 

 

Create Custom Email Recipient List

Scenario: client wants notifications for their Schedule a Tour form submissions sent to a different set of email recipients than their other lead forms:

  1. Add a custom value to the applicable location: Name = tour_email (can use any word,  but multiple words must be separated by underscores)' Value = the email address(es), separated by commas

  2. Add the following liquid code in the Form Builder for the applicable form, in the Facility Email Recipient field::

    • {% if!store.tour_email %}{{ store.tour_email }}{% else %}{{ store.email }}{% endif %}

      • Note: if client is not using the Facility Email field (field is typically used as maintenance request email recipient list) then that field can be used rather than adding a custom value; add the following code in that field:

        • {% if !store.maintenance %} {{ store.maintenance }} {% else %} {{ store.email }} {% endif %} => send a test form and if not sent to recipients because Facility Email field is blank, then use {% if !store.maintenance != empty %} so liquid knows that when the field is blank (empty), to use the emails from the Quote Email field instead