top of page

Templates : Custom Field : Macros for Dynamic Fields

In Lucit Templates dynamic fields are represented in object notation surrounded by either 1 or 2 sets of curly braces

In HTML and CSS Files, we use standard single curly brace notation

Basic Syntax


In Javscript, we use double-curly brace notation in order to provide additional escape protection



Generally, you will see support for the following objects


The inventory item to which this dynamic creative is attached. This could be a product, a vehicle, property, etc.


The account that this item belongs to


The user that created this item


The digital screen that this creative is running on

Using Macros in HTML

HTML Elements connected to dynamic fields take a form like the following example.

Note the use of single curly-braces {} surrounding the price macro

  class="lc_ut_designer lc_dt_data lc_dt_text lc_format_fit_text lc_format_price_us"

At render time, the following occurs in the following order:

  1. The data-value attribute is replaced with the value of the item price

  2. Any formatting functions are applied (in this case we have lc_format_fit_text and lc_format_price_us

  3. The final value is rendered in the innerHTML of the div

Using Macros in Javascript

In Javscript functions, we use the double-curly brace syntax in order to handle escaping issues when evaluating the functions.

Here is simple example that adds 500 to the price of the item

Note the double curly braces

Here is another example, using the fnConcat function.

Since this function requires strings, we must also enclose our macros in single quotes.

Standard Macros

There is a set of standard macros available on all templates. These exist regardless of the data source available, or, if you are building post templates.

Item Macros



Original Price	

Item Image	

Item Image (No Background)	



Sub Model (Trim)	


Stock #	
Account Macros



Logo (No Background)	

User Macros

First Name	

Last Name	

Job Title	

Mobile Phone #	

Office Phone #	


Profile Image	

Profile Image (No Background)	

Screen Macros (Digital Board)

City Name Possessive	

State / Province	

State Possessive	


Country Possessive	

State / Province Code	

State Code Possessive	

Postal Code	

Country Code	

Country Code Possessive	

Data Source Macros

In addition to standard macros, data sources can create additional properties on item, account, and digital_board objects that you can use on templates for accounts that have added these data source applications

When data sources create additional macros, you will see them in your Dynamic Fields List, and you will also see a reference to them in the Custom Field editor

Here is an example from an Automotive data feed that created macros for various automotive things like body style, mileage, color, etc.

Here is another example of Weather related macros that are attached to the digital_board object

Each individual app may or should provide a reference to the macros that they provide in their application


댓글 작성이 차단되었습니다.
bottom of page