Skip to main content
MindTouch Success Center

Embedded Contextual Help Touchpoint Events

Applies to:
MindTouch (current)
Role required:
Admin

Events

mindtouch-web-widget:view-article:ready

Fired when the view article widget is created. The event data contains the following parameters:

  • embedId <String> - The ID string of the widget that uniquely identifies it
 document.addEventListener('mindtouch-web-widget:view-article:ready', ({ data }) => {
    const embedId = data.embedId;
});

mindtouch-web-widget:view-article:loaded

Fired when the view article widget is loaded. The event data contains the following parameters:

  • embedId <String> - The ID string of the widget that uniquely identifies it
  • widget <Object> - The object interface to the widget that contains the properties and/or functions listed below
document.addEventListener('mindtouch-web-widget:view-article:loaded', ({ data }) => {
    const embedId = data.embedId;
    const widget = data.widget;
});

mindtouch-web-widget:view-article:location-changing

Fired when the view article widget is preparing to navigate to a URL. The event data contains the following parameters:

  • embedId <String> - The ID string of the widget that uniquely identifies it
  • href <String> - The URL string that the widget is preparing to navigate to
document.addEventListener('mindtouch-web-widget:view-article:location-changing', ({ data }) => {
    const embedId = data.embedId;
    const href = data.href;
});

mindtouch-web-widget:view-article:location-changed

Fired when the view article widget has navigated to a URL. The event data contains the following parameters:

  • embedId <String> - The ID string of the widget that uniquely identifies it
  • href <String> - The URL string that the widget navigated to
document.addEventListener('mindtouch-web-widget:view-article:location-changed', ({ data }) => {
    const embedId = data.embedId;
    const href = data.href;
});

Properties

articlePath <String>

(Not to be confused with MindTouch Paths)

  • Gets the page path currently being viewed in the widget
  • Sets the page path and navigates to it. Set as a JavaScript object property or as adata-article-pathdata attribute on the mindtouch/embed script HTML tag
document.addEventListener('mindtouch-web-widget:view-article:loaded', ({ data }) => {
    const widget = data.widget;
    widget.articlePath = '{example-page-path}';
    const foo = widget.articlePath;
});
<script async="async" src="https://success.mindtouch.com/@embed/{guid}.js"></script>
<script type="mindtouch/embed" id="mindtouch-embed-{guid}" data-article-path="{example-page-path}"></script>

initialPath <String>

(Not to be confused with MindTouch Paths)

  • Gets the widget's initial navigation page path
document.addEventListener('mindtouch-web-widget:view-article:loaded', ({ data }) => {
    const widget = data.widget;
    const foo = widget.initialPath;
});

navButtonsVisible <Boolean>

  • Gets the navigation buttons (back, forward, home) visibility
  • Sets the navigation buttons (back, forward, home) visibility. Set as a JavaScript object property or as adata-nav-buttons-visibledata attribute on the mindtouch/embed script HTML tag
document.addEventListener('mindtouch-web-widget:view-article:loaded', ({ data }) => {
    const widget = data.widget;
    widget.navButtonsVisible = false;
    const foo = widget.navButtonsVisible;
});
<script async="async" src="https://success.mindtouch.com/@embed/{guid}.js"></script>
<script type="mindtouch/embed" id="mindtouch-embed-{guid}" data-nav-buttons-visible="{boolean}"></script>

openButtonVisible <Boolean>

  • Gets the open external button visibility
  • Sets the open external button visibility. Set as a JavaScript object property or as adata-open-button-visibledata attribute on the mindtouch/embed script HTML tag
document.addEventListener('mindtouch-web-widget:view-article:loaded', ({ data }) => {
    const widget = data.widget;
    widget.openButtonVisible = false;
    const foo = widget.openButtonVisible;
});
<script async="async" src="https://success.mindtouch.com/@embed/{guid}.js"></script>
<script type="mindtouch/embed" id="mindtouch-embed-{guid}" data-open-button-visible="{boolean}"></script>

canGoBack <Boolean>

  • Gets a true value if the back navigation button can navigate a page back in the widget navigation history
document.addEventListener('mindtouch-web-widget:view-article:loaded', ({ data }) => {
    const widget = data.widget;
    const foo = widget.canGoBack;
});

canGoForward <Boolean>

(Not to be confused with MindTouch Paths)

  • Gets a true value if the forward navigation button can navigate a page forward in the widget navigation history
document.addEventListener('mindtouch-web-widget:view-article:loaded', ({ data }) => {
    const widget = data.widget;
    const foo = widget.canGoForward;
});

Functions

goBack()

Navigates the view article widget to the previous page in it's navigation history

document.addEventListener('mindtouch-web-widget:view-article:loaded', ({ data }) => {
    const widget = data.widget;
    widget.goBack();
});

goForward()

Navigates the view article widget to the next page in it's navigation history

document.addEventListener('mindtouch-web-widget:view-article:loaded', ({ data }) => {
    const widget = data.widget;
    widget.goForward();
});

goHome()

Navigates the view article widget to the home page

document.addEventListener('mindtouch-web-widget:view-article:loaded', ({ data }) => {
    const widget = data.widget;
    widget.goHome();
});

openExternal()

Opens the page currently being viewed in the view article widget in a new browser tab or window

document.addEventListener('mindtouch-web-widget:view-article:loaded', ({ data }) => {
    const widget = data.widget;
    widget.openExternal();
});
  • Was this article helpful?