Used for template operations. Use this API for CRUD operations on templates and zones. This API also assists with retrieving and rendering templates for particular navigation states. For more information, view the API specification. To learn how to use templates in the UI, see Use Predictive Merchandiser templates.
This article teaches you how to use the Templates feature in Predictive Merchandiser, including how to:In the instructions below, a new template is created with two zones for use during a Cyber Monday sales event. One zone is used to display general search results while the other is used to promote specific products for the sale.Templates with zonesThe zones used in this article use different query profiles. To follow the instructions as described, you will need to begin with an app that has at least two query profiles.
LucidAcademyLucidworks offers free training to help you get started.The Course for Predictive Merchandiser: Template Manager focuses on how to use the templates included in Predictive Merchandiser and create your own custom templates:
Predictive Merchandiser: Template ManagerPlay Button
Visit the LucidAcademy to see the full training catalog.

Create a new template

  1. From the Templates screen, click the New Template button: New template
  2. In the Template Name field, enter a unique name. In this example, the value Cyber Monday is assigned.
  3. Select a value in Template Type. This example uses the landing template type. This value is read-only and for informational purposes only.
  4. Click the Save button to save the new template: Save
For detailed configuration information, see:

Add a zone to a template

Zones enable Managed Fusion users to create rules designed for specific query profiles. Combined with templates, this allows a search application to display results from multiple query profiles in the same view.In this example, two new zones are created for the Cyber Monday template.
  1. Click Existing to add an existing zone. In this example, the Main Results List zone is added by selecting the zone and clicking Apply.
    The Main Results List zone is the default zone. This zone can be edited but cannot be deleted.
  2. Create a new zone by clicking the New button: New zone
  3. In the Display Name field, enter a unique name for the zone. For this example, the value is Promoted.
  4. In the Query Profile file, select a value. This example uses a query profile named promotional-results. This query profile is configured with rules that pin products to the top of the results.
  5. In the Zone Type field, select a value. This example uses main-results-list. This value is read-only and for informational purposes only.
  6. Set the configuration options for the product image, title, and description per your preference.
  7. Click the Save button to save the new zone: Save
For detailed zone configuration details, see Zone configuration options.

Edit an existing zone

To edit a zone that is already added to a template, complete the following:
  1. Click Start Task.
  2. Click the pencil icon to edit the page.
  3. Click the wrench icon to edit the zone.
    To delete a zone, click the trash can icon.
  4. Edit the zone as needed and click Save.

Set triggering options

Triggers describe conditions that must be met for a template to display. Trigger options include a set date range and specific search terms.For more information, see Triggering configuration options.

Date range

  1. In the Triggering section, click 0 Active. Trigger 0 active
    If there are active triggers, this button changes to reflect that number. For example, this button will read 3 Active when 3 triggers are active.
  2. Click the date range selector and select a start and end date. For this example, choose a date range that includes today’s date.
  3. Click the Save button to save your changes: Save

Search terms

  1. In the Triggering section, click 0 Active.
  2. Click the Trigger button: New trigger
  3. In the Search Terms field, enter cyber monday.
  4. Set the Match Mode field to phrase.
  5. Click Add.
  6. Repeat the process to add a second trigger with Search Terms set to sales event and Match Mode to phrase.
  7. Click the Save button to save your changes: Save

Test the template

  1. Access Predictive Merchandiser.
  2. Enter one of the search terms you configured in set triggering options. This example used the search terms cyber monday and sales event.
    If today’s date does not fall within the template’s date range trigger, the template will not load.
If everything is configured correctly, the Cyber Monday template is loaded. You can now create different rules for both zones, including pinning promoted products in the Promoted zone.
ImportantUse /api/ before the templating operation, particularly if you are using this API for load testing. For example, use /api/templating/render/APP_NAME instead of /templating/render/APP_NAME. This ensures the API call does not go through the Managed Fusion UI, which can slow down your response time.