πŸ“Customising UI content

How to add custom content to the Trialogue user interface

Content Areas

Trialogue defines several content areas in the User Interface where custom content can be inject via helper functions. This allows fitting content to the context of your story, or translating UI texts into any language.

Content areas: left side bar (red), right side bar (yellow), user resonse hint (purple), nav bar back link (green), nav bar undo link (coming soon) (blue)
Exit modal content areas: modal title (red), modal body (green), modal footer (blue)

Injecting content via helper functions

To inject custom content into these content areas, edit the Story Javascript:

Editing the Story Javascript via the bottom left menu

and use the following helper functions:

  • inject_nav_back(navLinkBackContent)

  • inject_nav_menu(navLinkMenuContent)

  • inject_left_sidebar(leftSidebarContent)

  • inject_right_sidebar(rightSidebarContent)

  • inject_hint(userResponseHintContent)

  • inject_modal(modalTitleContent, modalBodyContent, modalFooterContent)

Code example

The code example below shows these functions in use as part of the Chatterpast story:

Last updated