General blocks
The blocks on this page can be added to any build type, hence considered "general".
Content/Text Block
The Content
block is a simple block that can be used to display a title and description. It can be used as an introduction to the quiz (= cover block) or as a conclusion.
Example:
{
"type": "Content",
"title": "Welcome to the quiz",
"description": "This quiz will test your knowledge about the world"
}
Ad Block
In the ad block it is optional to add a title
and description
- both are optional as the Ad
block does not necessarily need neither of them.
Adding ad blocks is possible in two ways:
- By using project ad slots
- By implementing a custom iframe
Project ad slots
To add an ad to your build using a project ad slot, you need to add the property projectSlot
in the Ad
block, consisting of:
Property | Required | Type | Description | Default |
---|---|---|---|---|
slotId | ✓ | Object | The ad slot to use | (no default) |
variables | Object | An object with key-value pairs to override ad slot variables | (no default) |
Example:
{
"type": "Ad",
"projectSlot": {
"slotId": "123456"
}
}
Example with variables:
{
"type": "Ad",
"projectSlot": {
"slotId": "123456",
"variables": {
"ad-variable-key1": "override-value1"
}
}
}
Custom iframe
To be more flexible with ads & to be more independent from the Riddle Creator you can add an Ad
block with the iframe
object set, consisting of:
Property | Required | Type | Description | Default |
---|---|---|---|---|
url | ✓ | URL | The URL the iframe should link to | (no default) |
height | integer | The height of the iframe in px; automatic resizing does not work with custom iframes | 80 |
Example:
{
"type": "Ad",
"iframe": {
"url": "https://www.example.com/ad.html",
"height": 250
}
}
Full example
For this example we build a poll with a content + ad block.
{
"type": "Poll",
"build": {
"title": "My poll",
"blocks": [
{
"type": "Content",
"title": "Welcome to the quiz",
"description": "This quiz will test your knowledge about France"
},
{
"type": "MultipleChoice",
"question": "What is the capital of France?",
"answers": {
"Paris": true,
"Lissabon": false,
"Berlin": false
}
},
{
"type": "Ad",
"projectSlot": {
"slotId": "123456"
}
}
{
"type": "MultipleChoice",
"question": "How do you say 'hello' in French?",
"answers": {
"Bonjour": true,
"Hallo": false,
"Ciao": false
}
},
],
}
}