Skip to content

download

A store file to download: a card, or with `inline` a link inside a sentence.

Where it sits

Body In the body Inside its texts
The store’s home Yes Yes
A custom page Yes Yes
A product’s page Yes Yes
An event’s page Yes Yes
A portfolio’s page Yes Yes
A lesson Yes Yes
An article Yes Yes

A text holds it as a <block type="download" props="…"></block> element: its props are those below but type, which the element’s own type names.

See Bodies for how a body holds its blocks.

Props

Name Type Required Description
id string Yes The block’s id, unique within its body.
type "download" Yes The block’s type.
fileId string No A store file’s id, listed in the read’s files. Defaults to "".
label string No What the link reads; the file’s name when unset.
fragment string No Where the file opens, such as a PDF page: #page=2.
inline boolean No Whether it shows as a link inside the sentence that holds it, rather than a card.
rules array of object No Who may download a private file: a buyer of any rule’s product (productId), at its tier (tierId) or above when it names one.
hidden boolean No Whether the block is hidden: it, and every block it holds, doesn’t show.

JSON Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The block's id, unique within its body."
    },
    "type": {
      "type": "string",
      "const": "download",
      "description": "The block's type."
    },
    "fileId": {
      "default": "",
      "type": "string",
      "description": "A store file's id, listed in the read's `files`."
    },
    "label": {
      "type": "string",
      "description": "What the link reads; the file's name when unset."
    },
    "fragment": {
      "type": "string",
      "pattern": "^#[\\w=&.~%-]{1,200}$",
      "description": "Where the file opens, such as a PDF page: `#page=2`."
    },
    "inline": {
      "type": "boolean",
      "description": "Whether it shows as a link inside the sentence that holds it, rather than a card."
    },
    "rules": {
      "minItems": 1,
      "maxItems": 8,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "productId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "tierId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "required": [
          "productId"
        ],
        "additionalProperties": false
      },
      "description": "Who may download a private file: a buyer of any rule's product (`productId`), at its tier (`tierId`) or above when it names one."
    },
    "hidden": {
      "type": "boolean",
      "description": "Whether the block is hidden: it, and every block it holds, doesn't show."
    }
  },
  "required": [
    "id",
    "type"
  ],
  "description": "A store file to download: a card, or with `inline` a link inside a sentence.",
  "additionalProperties": false
}

Type to search…

↑↓ navigate↵ selectEsc close