QuickEmbedOptions

The QuickEmbedOptions object is an extension of EmbedOptions and contains details for what content items should be embedded and any filter information required as well as details for the host instance and user login.

Constructors

quickEmbedOptions{contentId:string,
filters?: Filter, targets?:Target[], onLoad?: function (content:EmbeddedResult),
container: HTMLElement, host: string, userName?: string, password?: string}: EmbedOptions
  • Use this to set the details for embedding.
  • The content ID is the GUID string of the item that is to be embedded. Required.
  • Filters is the Filter object of items to drive filtering on the content. Optional.
  • Targets is the Target object of items to drive targeted filtering on the content. Optional.
  • The onLoad event function is a callback function that will be triggered once the content has been loaded and there is a result. Optional.
  • The container can be any legitimate HTML5 container - usually a DIV tag.
  • Host is the URL of the Pyramid instance. Required.
  • Injecting the username and password values can also authenticate the user at the same time. Optional.

Example

The following instantiates a new filter object and attaches a filter for the year 2020 from the dates dimension. This is then attached to the an EmbedOptions object called options, which is then added to the embed method call.

var fil = Filter.create(); fil.add("dates","years","2020"); var options = {contentId:"c20d42b4-be24-47cf-b711-d5782f048590", filters: fil, onLoad: ContentLoaded, container: $("myCont"), host: "https://mysite.com", userName: "john", password: "abc123!"} client.quickEmbed(options)

When the content has loaded up, the ContentLoaded function will be called and passed the EmbeddResult object.