Content templating allows you to dynamically replace pieces in your content with elements from your app, such as the app name, or the current page being viewed. This allows you to easily build content that adapts to what is being viewed.
Content templating is an Oomph 17 feature. Please ensure your app supports Oomph 17 before using this feature.
Within your templated content, the following variables are available for use.
-
APP_NAME
- The short name of the app, this is shown on the device home screen, e.g. Fitness. -
APP_LONG_NAME
- The long name of the app, e.g. UK Fitness Monthly. -
ISSUE_NAME
(or ISSUE) - The name of the current issue, e.g. September 2012. -
SECTION_NAME
- The name of the current section, e.g. Contents. -
SECTION_NUMBER
- The number of the section, e.g. 100. -
PAGE_NUMBER
- The number of the page currently being viewed, relative to the section (this is not an absolute page number), e.g. 5. -
DOWNLOAD_URL
- The URL to download the app from. -
SCREENSHOT_DATA
- A screenshot of the current page (supported in HTML templates only). This will be written into the HTML template as Base64 encoded data (see Data URIs). The image will be provided at the resolution of the device, it is not downscaled. -
SCREENSHOT_WITH_DEVICE_DATA
- As per the above screenshot, but also includes the device chrome around the screenshot (i.e. current sharing behaviour).
Note that the variables are case insensitive, so the following are all equivalent:
-
ISSUE_NAME
-
issue_name
-
Issue_Name
Content template variables cannot currently be used in text pages.
You can use these within your templates using the following syntax:
<html> <head> <title>Shared from the iPad edition of {{APP_NAME}} </head> <body> <p>View this great page from {{ISSUE_NAME}} of {{APP_NAME}} by downloading the app from {{DOWNLOAD_URL}}.</p> </body> </html>
Got a question? Ask a question to the Oomph Community or submit a new Support request.
Comments
0 comments
Article is closed for comments.