name: zab/hero
title: "Hero"
description: "Block hero to appear at the top of the page"
group: Content Elements
priority: -8
prefixFields: true
prefixType: full
fields:
  - identifier: Zab/GeneralRow
    type: Basic

  - identifier: opt_type
    type: Select
    label: "Type of Hero"
    renderType: selectSingle
    items:
      - label: "Basic"
        value: basic
      - label: "Advanced"
        value: advanced
    onChange: reload

  # Tab Content
  - identifier: tab_content
    type: Tab
    label: "Content"
  - identifier: row_1
    type: Palette
    fields:
      - identifier: pretitle
        type: TextInput
        label: "Pretitle"
        displayCond: "FIELD:zab_hero_opt_type:=:advanced"
  - identifier: title
    type: TextInput
    label: "Title"
  - identifier: info
    type: Textarea
    label: "Info"
    displayCond: "FIELD:zab_hero_opt_type:=:advanced"
  - identifier: row_2
    type: Palette
    fields:
      - identifier: cta
        type: Link
        label: "Button"
        allowedTypes:
          - page
          - url
          - file
        displayCond: "FIELD:zab_hero_opt_type:=:advanced"
      - identifier: cta_label
        type: TextInput
        label: "Button label"
        displayCond: "FIELD:zab_hero_opt_type:=:advanced"
  - identifier: row_3
    type: Palette
    fields:
      - identifier: opt_black_txt
        type: Checkbox
        label: "Black Font Color"
        renderType: checkboxToggle
        displayCond: "FIELD:zab_hero_opt_type:=:advanced"
      - identifier: opt_auto_height
        type: Checkbox
        label: "Adjust image size to text"
        renderType: checkboxToggle
        displayCond: "FIELD:zab_hero_opt_type:=:advanced"
  - identifier: image
    type: File
    label: "Image"
    maxitems: 1
    extendedPalette: false
    allowed: "jpg,jpeg,png,webp,avif"

  # Tab Links
  - identifier: tab_links
    type: Tab
    label: "Box Links"
  - identifier: box_title
    type: TextInput
    label: "Title"
    displayCond: "FIELD:zab_hero_opt_type:=:advanced"
  - identifier: box_opt_color
    label: "Card Color"
    type: Select
    renderType: selectSingle
    displayCond: "FIELD:zab_hero_opt_type:=:advanced"
    itemsProcFunc: 'Zab\ZabSite\Utility\ContentOptions->getColorSimple'
  - identifier: box_items
    type: Collection
    label: "Link Items"
    displayCond: "FIELD:zab_hero_opt_type:=:advanced"
    fields:
      - identifier: link
        type: Link
        label: "Link"
        allowedTypes:
          - page
          - url
          - file
