[
  {
    "name": "source",
    "label": "Where do posts come from?",
    "type": "choice",
    "display": "radio",
    "required": false,
    "default": "auto",
    "help_text": "Auto matches the certificate pathway on dynamic pages and shows the latest posts anywhere else. Use Specific tag on standard pages when you want one topic.",
    "choices": [
      ["auto", "Auto (pathway on certificate pages, latest elsewhere)"],
      ["tag", "Specific tag"],
      ["latest", "Latest posts"]
    ]
  },
  {
    "name": "slug_override",
    "label": "Tag slug",
    "type": "text",
    "required": false,
    "default": "",
    "help_text": "The tag's URL slug, not its display name — e.g. skin-cancer-medicine. Leave blank on Auto to use the certificate pathway.",
    "visibility": {
      "controlling_field": "source",
      "controlling_value_regex": "tag",
      "operator": "EQUAL"
    }
  },
  {
    "name": "fallback_to_latest",
    "label": "Show latest posts if the tag has none",
    "type": "boolean",
    "display": "toggle",
    "default": true,
    "help_text": "Stops the section disappearing when a tag is empty or mistyped.",
    "visibility": {
      "controlling_field": "source",
      "controlling_value_regex": "latest",
      "operator": "NOT_EQUAL"
    }
  },
  {
    "name": "columns",
    "label": "Columns",
    "type": "choice",
    "display": "select",
    "required": false,
    "default": "3",
    "help_text": "Desktop only. Drops to 2 on tablet and 1 on mobile. Set the post count to at least this number.",
    "choices": [
      ["2", "2"],
      ["3", "3"],
      ["4", "4"]
    ]
  },
  {
    "name": "all_posts_url",
    "label": "View all link URL",
    "type": "text",
    "required": false,
    "default": "",
    "help_text": "Used when there is no tag to link to — normally the blog listing page.",
    "visibility": {
      "controlling_field": "show_view_all",
      "controlling_value_regex": "true",
      "operator": "EQUAL"
    }
  }
]