In Designs you can create templates. The notion of a template is something that is reusable or can be a pattern for multiple purposes i.e. Blasts, Listing Flyers, Share and Embed, etc. Did you know Designs employ a very powerful templating framework which allows you to build templates that merge in data dynamically when they are used?
Let us provide a very simple example of how this works. Every listing has a name, address, price, and much more. This is its data. Let us say you have the listing for the Munster's Mansion. Imagine a template something like...
{{ListingName}}
{{Address}}
{{Price}}
When it is time to display the template, the listing's data is merged together with the template and the result becomes...
Munster's Mansion
1313 Mockingbird Lane, Mockingbird Heights, CA 12345
$1,500,000
RealtyZapp provides an extensive set of data for use in any deisgn. Below is a illustratoin of the data at your disposal...
In reality there are a lot more data elements but hopefully you get the idea. Note that the agent and company data elements are pretty simple (flat) whereas the listings element is comprised of a list and each listing has elements like photos which is a list of more things.
In the template example above, {{ListingName}} is a data merge token. Typically these tokens represent the data field name but there is more to the syntax than just that. Let us explain by providing some examples...
{{Name}} = agent's name. {{photos.[1].photoUrl}} = the listing's 2nd photo, not the 1st photo.
This is becasue data lists use [0] = 1st, [1] = 2nd, [2] = 3rd. Get it? {{agents.[0].Name}} = the listings 1st (primary) agent.
Yes, listings can have more than agent.
So, how do you know if {{Name}} is referring the agent or the company as they both have a Name field? That is where rest of the templating syntax comes into play so let us go over some features of the templating framework...
{{@root.agent.Name}} or {{@root.company.Name}} - @root means starting from the tip top of the data tree. Think of it like a full address to the data element.
{{#with @root.agent}} ... {{/with}} - a context wrapper where everything in between {{#with ...} and {{/with}} is assumed to be in the context of the agent data branch. Inside the wrapper you can simply use {{Name}}.
{{#each @root.listings}} ... {{/each}} - loop over each and every listing in the listings list.
{{#if Lease}} ... {/if}} - if the listing.Lease field is true, everything in between will be displayed. If listing.Lease is false then everything inbetween will be omitted.
In many of the built-in bloks and pre-made templates employ the templating syntax. The Agent, Company and Listing type bloks all employ just about every form of the templating syntax. Given the Listing blok for example, in order for it to not only loop listings but loop only certain listings it utilizes a special context...
{{#getLids ~lids~} ... {{/getLids}}
where getLids is a custom function that will loop only the listing(s) you have selected. Additionally, getLids function has super powers and can figure out that the listings are relevant to when and where the template is being displayed.
This is just the bare basics of the templating syntax. If you want to learn more about templating power...