siteKiosk.content



Example:

The below example explains a common use case and may help you getting started with the SiteKiosk API content interface.

Some initial steps:

  1. Add a new text element to your project.
  2. Add a tag to the element, we'll use myTextElement
  3. Edit the text elements content to {$myPlaceholder}

Now we'll add the custom script to replace the placeholder:

// We can not find elements if they are not inserted, yet.
// So first we'll wait for the content to be inserted:
siteKiosk.content.onContentInserted(() => {
// Find the text element by its tag:
const textElement = siteKiosk.content.getElementByTag("myTextElement");
if (!textElement) {
console.log("Oh no, no element found by tag :(");
return;
}

// We've found the text element and got the wrapped DOM element, let's replace the placeholder:
const dataToBeInserted = { myPlaceholder: "New text" };
textElement.replacePropertyPlaceholders("text", dataToBeInserted);

// Done, now the placeholder should be replaced with `New text`
// You can add more than one placeholder per text element, just adapt the `dataToBeInserted` object:
// const dataToBeInserted = { myPlaceholder: "New text", anotherPlaceholder: "Foo" };
});

Properties

dataBinding: DataBinding

Data binding related interface

editor: Editor

Editor related interface

extensionModules: ExtensionModules

Extension modules handling

mode: Mode

Information about the mode

navigation: Navigation

Navigation related interface

popups: PopUps

Handling pop-ups

project: Project

Project related interface

runtime: Runtime

Runtime related interface

Methods

  • Returns an unified currency string.

    Parameters

    • value: string | number

      A currency value string or number.

    Returns string

  • Returns a wrapped DOM element to the first element found by name.

    Parameters

    • elementName: string

      The name (e.g.: id4670136063630198857) of the element to be searched for.

    Returns undefined | WrappedDOMElement

  • Returns a wrapped DOM element to the first element found by the given parameters.

    Parameters

    • tagName: string

      The name of the tag to be searched for.

    • Optional startContentDomElement: HTMLElement

      The start DOM element to be searched from.

    Returns undefined | WrappedDOMElement

  • Returns an array of wrapped DOM elements found by the given parameters.

    Parameters

    • propertyName: string

      The name of the property to be searched for.

    • propertyValue: any

      The value of the property to be searched for.

    • onlyTestForDefined: boolean

      Whether to only test if property value is defined.

    Returns WrappedDOMElement[]

  • Returns an array of wrapped DOM elements found by the given parameters.

    Parameters

    • tagName: string

      The name of the tag to be searched for.

    • Optional startContentDomElement: HTMLElement

      The start DOM element to be searched from.

    Returns WrappedDOMElement[]

  • Returns an array of wrapped DOM elements found by the given parameters.

    Parameters

    • tagStart: string

      The name of the tag that starts with a specific string to be searched for.

    • Optional startContentDomElement: HTMLElement

      The start DOM element to be searched from.

    Returns WrappedDOMElement[]

  • Returns an array of wrapped DOM elements found by the given parameters.

    Parameters

    • tags: string[]

      The tags to be searched for.

    • Optional startContentDomElement: HTMLElement

      The start DOM element to be searched from.

    Returns WrappedDOMElement[]

  • Returns the physical path to the local content on the player.

    Returns string

  • Registers an event handler called once the content is inserted. Call this with a callback and it will be called whenever the content is inserted into the DOM if it has already been inserted at the time of this method call, the callback will be called in the next event loop iteration

    Returns

    Event subscription delete function

    Parameters

    • callback: (() => void)
        • (): void
        • Returns void

    Returns (() => void)

      • (): void
      • Registers an event handler called once the content is inserted. Call this with a callback and it will be called whenever the content is inserted into the DOM if it has already been inserted at the time of this method call, the callback will be called in the next event loop iteration

        Returns

        Event subscription delete function

        Returns void

  • Registers an event handler called once the content is updated.

    Parameters

    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • Registers an event handler called once the content is ready.

    Parameters

    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • Registers an event handler called once the content reset.

    Parameters

    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • Register a new content behaviour extension.

    Parameters

    • behaviourType: string

      The behaviour type.

    • createFunction: any

      The behaviour create function.

    Returns void

  • Returns the real (internal) file name by resolving display name (original name) in "other files" (files imported into media lib). If no file is found, an empty string is returned.

    Parameters

    • fileNameOrDisplayName: string

      The name of the file to be searched for.

    Returns string

  • Returns the file name found by the given parameter.

    Parameters

    • id: string

      The file id to seach for.

    Returns string

  • Returns the full path to the file with the provided file name.

    Parameters

    • fileNameOrDisplayName: string

      The name of the file to be searched for.

    Returns string

Generated using TypeDoc