You can add fields into your templates that will get substituted with real values when a listing is shared.
The list of fields available is:
Field | Description |
address | Listing address |
bedrooms | Bedrooms |
bathrooms | Bathrooms |
garages | Garages |
title | Listing title |
agent | Agent Name |
agents.profile_photo | Agent photo URL |
agent_phone | Agent Phone Number |
price | Price |
Adding fields
There are two ways to add replaceable fields.
The replaceable fields replace the entire text value,
eg if bedrooms=2
<text field="bedrooms">Number Bedrooms</text>
becomes
<text field="bedrooms">2</text>
OR use %field% to replace the text. For example if %bedrooms% is found, only that will be replaced.
Example:
<text field="bedrooms">$bedrooms$ Bedrooms</text>
becomes
<text field="bedrooms">2 Bedrooms</text>
The logic for interaction between the two is:
if there is a string "$bedrooms$" then replace that with 2
else
replace the entire text field with 2
Hiding fields
Sometimes you don't want the field to appear if the value is blank or 0 (zero).
For example you don't want to have a template say "0 garages".
You can hide the field by adding the visibility attribute eg:
<text field="garages" visibility="garages">2</text>
This will hide the text field if garages is 0 or blank. You can add the visibility to other elements such as an icon or text so that it will not appear if the field is blank. For example, here is an SVG icon within the SVG template that will not show if garages is 0 or blank:
<svg visibility="garages" x="40" y="1000" width="28" height="28" viewBox="0 0 15 10" fill="none">
<path d="M4.125 4.99902C5.15883 4.99902 6 4.15785 6 3.12402C6 2.0902 5.15883 1.24902 4.125 1.24902C3.09117 1.24902 2.25 2.0902 2.25 3.12402C2.25 4.15785 3.09117 4.99902 4.125 4.99902ZM12.375 1.99902H7.125C6.91781 1.99902 6.75 2.16684 6.75 2.37402V5.74902H1.5V0.874023C1.5 0.666836 1.33219 0.499023 1.125 0.499023H0.375C0.167812 0.499023 0 0.666836 0 0.874023V9.12402C0 9.33121 0.167812 9.49902 0.375 9.49902H1.125C1.33219 9.49902 1.5 9.33121 1.5 9.12402V7.99902H13.5V9.12402C13.5 9.33121 13.6678 9.49902 13.875 9.49902H14.625C14.8322 9.49902 15 9.33121 15 9.12402V4.62402C15 3.17418 13.8248 1.99902 12.375 1.99902Z" fill="white"/>
</svg>
Agent Photo
You can add the agent photo to the SVG with the following line, adjusting the size and position where you want it to appear:
<image visibility="agents.profile_photo" y="820" x="200" href="$agents.profile_photo$" field="agents.profile_photo" width="140" height="140"/>