Premium

Design FAQ

Last update: 2024-07-30

List of frequently asked questions (FAQs) about Adobe Target Recommendations designs.

By default, numeric values (such as entity.value) returned in design templates won’t display any trailing zeroes after the decimal point. For example, if an item is $35.00, entity.value is equal to 35 and only 35 is displayed on the page, not $35.00.

Two options are available to address this issue:

  • You can use Velocity scripting or Javascript to apply formatting to the returned value.

  • You can pass the price of the item into two separate entity attributes. The first, entity.value, can be used for numeric comparisons (such as price comparison rules). The second should be a custom attribute, such as entity.displayValue that stores the value of the entity as a string to allow for proper rendering.

    For example,

    "entity.value" : 35.00, "entity.displayValue" : "$35.00"

Why isn’t category showing in the design? I’m using $entity1.categoryId.

Category ID can’t be displayed in the design. Because multiple categories can be stored, the system does not know which category to display.

How should I change a design to get an instant update?

Altering the design that is currently in use takes a while to update. To change the design instantly, create a new design, select it in the activity, and save the recommendation.

How can I capture key information for display in the design? Example: If we want to display the key product’s category, how would I code that value in the velocity design?

The $key. *value* parameter captures most of the key product’s information to display within the design. For example, if you want to display the key product’s thumbnail, use $key.thumbnailURL.

Which version of Velocity is used?

Version 1.7 with no additional tools or libraries added in. Basic Velocity functionality is available.

How do I replace an existing entity value with a blank? For example, an item’s entity.message needs to be cleared when a promotion ends.

Sending in a JavaScript non-breaking space seems to do this. Have the developers send in \u00A0 as the value. Example: entity.message=\u00A0. You might consider having that be the default value when no value is present instead of a null.

Can I use a profile script in a Recommendations design?

Yes. To use a profile script in a Recommendations design, wrap the name in \${...}. For example, if your profile script is named user.basket, refer it as \${user.basket} in the design. Note that the backslash implies that the profile script is not rendered by Velocity. Therefore, you cannot perform any operations on the profile script in a Velocity template. The value will be directly printed on the page.

On this page