We’re here to help

Custom URL Schemes for Twixl publications

Follow

A number of custom URL schemes can be used in a web hyperlink, a web viewer, a web overlay, the kiosk info page, the kiosk info cell, in the entitlements dialog and the embedded web browser.

Article and page links

(Available in a hyperlink, a web viewer or a web overlay)

If you want to add a link to a page in your publication from within a web viewer or web overlay window, you can do so by creating an HREF like the one below:

tp-pagelink://{article_name}/{page_number}

An example would be:

<a href="tp-pagelink://TOC/3">

In Twixl Publisher 4.0, a number of new URL schemes for relative article and page navigation have been added:

tp-next-article://show
Go to the next article.
tp-previous-article://show
Go to the previous article.
tp-first-article://show
Go to the first article of the publication.
tp-last-article://show
Go to the last article of the publication.
tp-next-page://show
Go to the next page (if at the last page of an article, go to the next page in the following article).
tp-previous-page://show
Go to the previous page (if at the first page of an article, go to the last page of the previous article).
tp-first-page://show
Go to the first page of an article.
tp-last-page://show
Go to the last page of an article.
tp-article-top://show
Go to the top of a long-page article.
tp-article-bottom://show
Go to the end of a long-page article.

Show/hide toolbar

(Available in a web viewer and web link)

tp-toolbar://hide
Hides the toolbar with the Table of Contents icon, and optional sharing and bookmarking icons.
tp-toolbar://show
Displays the toolbar with the Table of Contents icon, and optional sharing and bookmarking icons.
tp-toolbar://toggle
Toggles the current view, whether visible or invisible.

NOTE:

These schemes can also be used with the legacy scrubber TOC viewer.

Show Table of Contents

(Available in a hyperlink, a web viewer or a web overlay)

tp-toc://show

When the tp-toc://show url is triggered, it will:

  • show the Table of Contents dropdown

Show bookmarks

(Available in a hyperlink, a web viewer or a web overlay)

tp-bookmarks://show

When the tp-bookmarks://show url is triggered, it will:

  • show the title bar
  • open the TOC popup highlighting the bookmarks.

Phone call

callto:[number]

Allows you to trigger a phone call. Note that this will work on phones only.

Example:

callto:+32493252577

History (go back)

(Available in a hyperlink, a web viewer or a web overlay)

tp-history://back 

Allows you to navigate to the page that was visited before the current page.

Pause/resume playback of background music

If you are using background music in your publication, use the URL schemes below to pause or resume playback of the music:

tp-background-music://pause
tp-background-music://resume

NOTE:

Background music is only available for issue-based apps.

Close the current window

(Available in a web overlay, an embedded web browser (i.e. the one triggered by tapping a hyperlink), the kiosk infoPage.html and the Entitlements dialog)

tp-close://self

Closes the current window.

Launching an app

It is possible to trigger launching an app from within a Twixl publication using the following scheme:

Please note that the implementation is slightly different on iOS vs Android.

  • iOS: the URL scheme is the same as the application identifier:

e.g. if the app identifier is "com.twixlmedia.myapp" -> then the URL to launch the app would be: com.twixlmedia.myapp://

  • Android: the URL scheme is the same as the app identifier without the dots, dashes, underscores and all lowercase:

e.g. if the app identifier is "com.twixlmedia.myapp" -> the the URL to launch the app would be: comtwixlmediamyapp://

IMPORTANT NOTE:

This will only work if the app is already installed on the device.

Opening a hyperlink in the device browser

(available for hyperlinks)

Although in most cases, you want to keep readers in the embedded browser, sometimes you may want to open a link directly in Safari on iPad or in the default browser on Android. A good use case for this is if you want to link to a PDF that you want readers to be able to download.

You can do this by adding an extra parameter to your URL:

tp-open-in-device-browser=1

The URLs below will open in the embedded app browser:

http://www.website.com/file.pdf?id=1

http://www.website.com/file2.pdf

And these will open in the device browser:

http://www.website.com/file.pdf?id=1&tp-open-in-device-browser=1

http://www.website.com/file2.pdf?tp-open-in-device-browser=1

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.