Simple Text Feed
Overview
Simple text feeds support very simple html formatted text content with optional integration into the menu structure, support for images and linked offline content (e.g. MP3s, PDFs,…).
In the example above, the menu item “STUDIEREN” comes from an anchor with the label “Studieren”, and an id “studieren”. The anchor’s id will be used in the url of the page (#studieren).
The content in above’s example is an h2 headline with two paragraphs. Paragraph can contain typical rich text formatting html tags.
Example JSON
{
"apiVersion": 1,
"anchor": {
"id": "studieren",
"label": {
"en": "Studies",
"de": "Studieren"
}
},
"text": {
"en": "<h1>an h1 header</h1><p>a paragraph using <b>bold text</b></p>",
"de": "<h1>ein h1 header</h1><p>ein Paragraph mit <b>fettem Text</b></p>"
}
}
Validations
apiVersion
must be set to 1 (as a number, not a string)anchor
is an object and optionalThis property describes an anchor
id
is string and mandatory if theanchor
objec` is presentThe property is equivalent to the HTML anchor URL part (e.g. #studieren)
Label
is an object with a mapping of object to label stringIt is mandatory if the
anchor
object is presentThe language is an ISO 639-1 code
The label string value is equivalent to the text in the 2nd menu level
Allowed html entities:
soft hyphen:
text
is an object and mandatoryIt contains a mapping of language to content string
Every specified language property needs a mandatory non-null content string value
The language identifier is an ISO 639-1 code
Content string value per language:
It is a subset of HTML
Allowed tags are:
Headers:
h1
-h6
Paragraph:
p
Text spans:
span
Lists:
ul
,ol
,li
Simple rich text formatting:
b
,i
,u
,em
,strong
,ins
,blockquote
Links:
a
Images:
img
,figure
,figcaption
(see below)Gallery:
gallery
(see below)Video:
video
(see below)Audio:
audio
(see below)Media sources:
source
HTML newline:
br
Allowed html entities:
soft hyphen:
­
;
Special formatting:
p
-tags can be formatted using the classnewsarticle__lead
to present a special format for lead texts suitable for news articles
Internationalization Validations
If a text is present in a certain language, and the anchor object is present, then labels must be translated in the same languages as the texts At least one language must be present
Images
Images are supported through plain <img>
tags, and can also be wrapped within a <figure>
tag, optionally accompanied with a <figcaption>
tag.
Gallery support
Galleries are supported using a custom <gallery>
tag. Currently only the gallery variant carousel
is supported. Example:
<gallery variant="carousel">
<figure>...</figure>
<figure>...</figure>
</gallery>
The figures will be shown in a carousel gallery.
Video tag support
Text feeds support the video tag including:
multiple
source
sub-tagssrc
attributetype
attributecontrols
attributehtml formatted fallback text (all other tags are allowed)
<video controls>
<source src="/media/video1.m4v" type="video/mp4" />
<p>Your browser doesn't support HTML5 video.</p>
</video>
A browser-native HTML5 video player will be shown. Formats have to be compatible with all targeted browsers. There will be no automatic audio format conversion.
Audio tag support
Text feeds support the audio tag including:
multiple
source
sub-tagssrc
attributetype
attributecontrols
attributehtml formatted fallback text (all other tags are allowed)
<audio controls>
<source src="/media/t-rex-roar.m4a" type="audio/mp4" />
<p>Your browser does not support the audio element.</p>
</audio>
A browser-native HTML5 audio player will be shown. Formats have to be compatible with all targeted browsers. There will be no automatic audio format conversion.
Linked resources in offline setups
Within Unwired Cloud access points in offline configuration, the first level of linked resources is fetched and stored with the feed content.
Example:
<a href="https://url/to/an/audio/file.mp3">some audio file</a>
The example above links to an mp3 audio file, that will be stored with the feed content and will be available offline. This is supported for typical media types:
image/jpeg
, image/png
, image/gif
, image/jpg
application/pdf
audio/mp4
, audio/x-aiff
When there is no extension (.mp3
, .pdf
) within the HREF attribute of your <a />
tag, the URL will most likely be ignored. To make sure it will be available offline even without extension, add the attribute unwired-fetch-resource="true"
to the <a />
tag. This mechanism prevents us from sending unnecessary requests to your API.
Content revisions table
Revision |
Published date |
Changes |
---|---|---|
1.0 |
2018-07-01 |
initial release |
1.1 |
2018-09-08 |
added POI information, clarified content |
1.4 |
2019-01-16 |
added DS100 and IBNR match options for POI |
1.5 |
2019-01-19 |
clarified on how to disable the POI_match feature |
1.6 |
2020-09-02 |
added newsarticle__lead |
1.7 |
2023-08-31 |
moved to public docs |