Skip to content

ContentBlock

Bruno Hautzenberger edited this page Nov 29, 2018 · 2 revisions
  • Type: contentblocks

ContentBlock entities represent a part of a page. They can have various different types with different data. A content block can be as simple as a text block, containing title and text, or as complex as a spotmap block, containing tags, which require the client to do a second API call to query for spots witrh this tags and then display a map with the spots retrieved by the second call. Even though Contentblocks have an idea they can not be retrieved by id or any other query. You can only get contentblocks as part of a content response.

Attributes

  • block-type - (Int) Specifies which type of content this block contains. (see -> Block Types)
  • public - (Bool) If false, this contentblock should be ignored on not mobile platforms.
  • title - (String) Localized title of this content block. Relevant for all block types except for 6. On block type 3 (image) this should be used as image caption.
  • text - (String) Localized text of this content block. Only relevant for block type 0.
  • artists - (String) Localized artist string of this content block. Only relevant for block type 1.
  • file-id - (String) Url of the attached file (image, audio, ...). Only relevant for block type 1, 3, 5 and 8.
  • soundcloud-url - (String) Url of the soundcloud page that should be used to show a soundcloud player here. Only relevant for block type 7.
  • link-type - (Int) Defines which kind of link this link block contains. Only relevant for block type 4. (see -> Link Types)
  • link-url - (String) Url of this link block. Only relevant for block type 3 and 4.
  • download-type - (Int) Defines which kind of file this download block contains. Only relevant for block type 8. (see -> Download Types)
  • spot-map-tags - (Array) Tags used to query for the spots that should be shown on this map. Only relevant for block type 9.
  • content-list-tags - (Array) Tags used to query for the content items that should be shown here as a list. Only relevant for block type 11.
  • content-list-sort-asc - (Bool) Specifies if the content list should be sorted asc or not. Only relevant for block type 11.
  • content-list-page-size - (Int) Defines the page size for each page of the content list query. Only relevant for block type 11.
  • scale-x - (Int) Defines the width in percent, relative to the current device width for the image. Only relevant for block type 3.
  • video-url - (String) Url of the video to show here. Only relevant for block type 2.
  • should-show-content-on-spotmap - (Bool) Specifies if the spot map should show links to the content attached to each spot on the map. Only relevant for block type 9.
  • alt-text - (String) Alt-Text for images. Only relevant for block type 3.
  • copyright-text - (String) Copyright text for images. Only relevant for block type 3.

Block Types

0 - Text

A simple text block. Containing a title, which is something like a headline in most cases, and text, which can contain simple html.

1 - Audio

This block should always be implemented as a native audio player, prepared to played on single file from a url (file-id). It also has a text, which contains the name or a description of the audio file and a text "artists", which contains the artist of this track.

2 - Video

This block contains a url in the "video-url" field, which can either point to Youtube, Vimeo or directly to a video file. For all of these cases the UI has to implement a player showing the video depending on its source. It also has a title, which is used to describe the video.

3 - Image

This block contains the url of an image in the "file_id" field. It also has a "title", which is used as image caption, an "alt-text", which of course is used as alt-text for this image, a "link-url", which is used to redirect the user to a specific url, if the image is clicked, a "copyright", which contains the copyright information for this image and also a filed "scale-x", which defines the width in percent, relative to the current device width, for the image.

4 - Link

This block contains a url in the "link-url" field, which is the target of this link. It also contains a "title" and "text", which are used to describe this link and also a "link_type", which defines what kind of link this is. (see -> Link Types)

5 - Ebook

This block contains the url of a PDF, Ebup or Mobi file in the "file-id" field. This file should be downloaded to the user's device, if he interacts with the content block. It also contains a "title" and "text", which are used to describe this ebook.

6 - Content

This block contains the id of a referenced content (page) in the field "content-id". This block is used to navigate from one content item to another. To show informations like the title or the cover image of the referenced content in this content block, you need to retrieve this content item by id. Please always use the right x-reason header (see -> Setting Content Request Reasons) when getting a content for reasons like this.

7 - Soundcloud

This block contains the url of the soundcloud page that should be used to show a soundcloud player here. It also contains a "title", which is used to describe this soundcloud track.

8 - Download

This block contains the url of a vCard or iCal file in the "file-id" field. This file should be downloaded to the user's device, if he interacts with the content block. It also contains a "title" and "text", which are used to describe this download as well as a "download-type" (see -> Download Types), which is used to show the user what kind of file this is.

9 - Spotmap

This block is used to show the user a map of spots. It is totally up to you, which kind of map you use to do so. The block contains a field "spot-map-tags", which contains the tags you need to query for spots (see -> Spot). The result of this query are the spots, which you should display on this map. Keep in mind that the result of this query can have several pages, which means you have to keep loading spots until you got all of them. This content block also contains a title, which is used to describe this map, and the "should-show-content-on-spotmap" flag, which if true, indicates, that you should also display information about and maybe a way to get to the content that is attached to each spot on the map.

10 - Include

You will never receive this kind of content block via this API. Instead you will any other content blocks of a referenced content item at this position. So just ignore it, you will simply get content blocks here like they were a part of this page.

11 - Content List

This block is used to show a list of references to other content items. It works similar to the Spot Map block. It contains tags in the "content-list-tags" field, which you need to query for content (see -> Content) and show them as a list at this position. It also contains a field "content-list-page-size", which defines the page size for your query and a flag "content-list-sort-asc", which indicates if it should be sorted ASC or DESC. This also means that you should let the user manually load the next page, using something like a "load more" button until the query has returned all results.

Link Types

0 - Facebook

Indicates that link points to Facebook. Style it accordingly.

1 - Twitter

Indicates that link points to Twitter. Style it accordingly.

2 - Web

Indicates that link points to a common web site. Style it accordingly.

3 - Shopping

Indicates that link points to a web shop. Style it accordingly.

4 - Wikipedia

Indicates that link points to Wikipedia. Style it accordingly.

5 - LinkedIn

Indicates that link points to LinkedIn. Style it accordingly.

6 - Flickr

Indicates that link points to Flickr. Style it accordingly.

7 - Soundcloud

Indicates that link points to Soundcloud. Style it accordingly.

8 - iTunes

Indicates that link points to iTunes. Style it accordingly.

9 - Youtube

Indicates that link points to Youtube. Style it accordingly.

10 - Google Plus

Indicates that link points to Google Plus. Style it accordingly. (or ignore it, since it isn't really a thing anymore, ...)

11 - Telephone

Indicates that link contains a telephone number link. Style it accordingly and try to use it to open a dialer if possible (example: tel:12345).

12 - Email

Indicates that link contains an email link. Style it accordingly and try to use it to open an email app if possible (example: mailto:me@youknow.com).

13 - Spotify

Indicates that link points to Spotify. Style it accordingly.

14 - Google Maps

Indicates that link points to Google Maps. Style it accordingly.

15 - iTunes App

Indicates that link points to an App in the iOS App Store. Style it accordingly.

16 - Google Play

Indicates that link points to an App in the Android Google Play Store. Style it accordingly.

17 - Windows Store

Indicates that link points to an App in the Windows App Store. Style it accordingly.

18 - Instagram

Indicates that link points to Instagram. Style it accordingly.

Download Types

0 - VCF

Indicates that this file is a vCard. Style it accordingly.

1 - iCal

Indicates that this file is an iCal file. Style it accordingly.

2 - GPX

Indicates that this file is a GPX file. Style it accordingly.

Example ContentBlock Response

(see -> Content)

You can’t perform that action at this time.