Profile: has-html-blocks

Profile Schema

The has-html-blocks profile designates a document that contains html-blocks. While any document can contain html-blocks without the has-html-blocks profile, clients looking for an html block within a document will likely target the html-blocks array provided by this profile, so it is highly recommended that a document with an html block lists a has-html-blocks profile.

Structure

has-html-blocks specifies one required attribute: html-blocks. html-blocks is an array of links to an html block used by this document.

The html-blocks array must contain one or more links; all links must be asset links that begin with #/.

Example has-html-blocks document

{
    "id": "12345",
    "profiles": [
        {
            "href": "/v1/profiles/has-html-blocks",
            "rels": [
                "interface"
            ]
        },
        {
            "href": "/v1/profiles/document"
        }
    ],

    "html-blocks": [
        {
            "href": "#/assets/5678",
        }
    ],

    "assets": {
        "5678": {
            "id": "5678",
            "html": "<strong>You won't believe this</strong>",
            "profiles": [
                {
                    "href": "/v1/profiles/html-block",
                    "rels": [ "type" ]
                },
                {
                    "href": "/v1/profiles/document"
                }
            ]
        }
    }
}

© 2024 npr