# 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 ```json { "apiVersion": 1, "anchor": { "id": "studieren", "label": { "en": "Studies", "de": "Studieren" } }, "text": { "en": "

an h1 header

a paragraph using bold text

", "de": "

ein h1 header

ein Paragraph mit fettem Text

" } } ``` ## Validations - `apiVersion` must be set to 1 (as a number, not a string) - `anchor` is an object and optional - This property describes an anchor - `id` is string and mandatory if the `anchor` objec` is present - The property is equivalent to the HTML anchor URL part (e.g. #studieren) - `Label` is an object with a mapping of object to label string - It is mandatory if the `anchor` object is present - The 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 mandatory - It 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 class `newsarticle__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 `` tags, and can also be wrapped within a `
` tag, optionally accompanied with a `
` tag. ## Gallery support Galleries are supported using a custom `` tag. Currently only the gallery variant `carousel` is supported. Example: ```html
...
...
``` The figures will be shown in a carousel gallery. ## Video tag support Text feeds support the video tag including: - multiple `source` sub-tags - `src` attribute - `type` attribute - `controls` attribute - html formatted fallback text (all other tags are allowed) ```html ``` 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-tags - `src` attribute - `type` attribute - `controls` attribute - html formatted fallback text (all other tags are allowed) ```html ``` 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: ```html some audio file ``` 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 `` 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 `` 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
added support for soft hyphens
added support for video and audio tags | | 1.6 | 2020-09-02 | added newsarticle\_\_lead
content-type header requirement | | 1.7 | 2023-08-31 | moved to public docs |