For the complete documentation index, see llms.txt. This page is also available as Markdown.

Template

`ff-template` renders custom markup from a selected FactFinder response or supplied data. Use `scope` for endpoint responses or set `data` through JavaScript.

Documentation

Subscribing to an endpoint

Set the scope attribute to make ff-template subscribe to the specified endpoint.

<ff-template scope="SearchAndNavigation">{{totalHits}} results found.</ff-template>

Available values for scope are:

  • CampaignPage

  • CampaignProduct

  • CampaignShoppingCart

  • Compare

  • Navigation

  • NavigationCategory

  • PredictiveBasket

  • Recommendation

  • Records

  • Search

  • Similar

  • Suggest

  • SearchAndNavigation (special scope)

These values mirror the supported FactFinder API endpoints. They are also available for subscribing in the factfinder.response namespace.

Only CampaignRedirect is not available to ff-template.

SearchAndNavigation is a special scope that makes ff-template simultaneously listen to Search and Navigation responses. Both endpoints have a very similar purpose, and they return the same data structure. With this scope, you can use one HTML template for search result pages and category pages.

SearchAndNavigation is likely the most useful scope.

Passing custom data without subscribing

ff-template has a data property which you can access through JavaScript. This property takes any type of data.

Last updated

Was this helpful?