name: zab/media-mixed
title: "Media Mixed"
description: "Block with image|text or text|image"
group: Content Elements
priority: -13
prefixFields: true
prefixType: full
fields:
  - identifier: Zab/GeneralRow
    type: Basic

  - identifier: opt_layout
    type: Select
    label: "Type of Layout"
    renderType: selectSingle
    items:
      - label: "Image | Text"
        value: image-text
      - label: "Text | Image"
        value: text-image

  # Tab Header
  - identifier: tab_header
    type: Tab
    label: "Header"
  - identifier: pretitle
    type: TextInput
    label: "Pretitle"
  - identifier: title
    type: TextInput
    label: "Title"
  - identifier: info
    type: Textarea
    label: "Info"

  # Tab Content
  - identifier: tab_content
    type: Tab
    label: "Content"
  - identifier: row_1
    type: Palette
    fields:
      - identifier: opt_type_media
        type: Select
        label: "Type of Media"
        renderType: selectSingle
        default: "media-image"
        items:
          - label: "Image"
            value: media-image
          - label: "Video"
            value: media-video
        onChange: reload
      - type: Linebreak
      - identifier: image
        type: File
        label: "Image"
        maxitems: 1
        extendedPalette: false
        allowed: "jpg,jpeg,png,webp,avif"
        displayCond: "FIELD:zab_mediamixed_opt_type_media:=:media-image"
      - identifier: media_url
        type: Text
        label: Media URL
        displayCond: "FIELD:zab_mediamixed_opt_type_media:=:media-video"

      - type: Linebreak
      - identifier: opt_behavior
        type: Radio
        label: "Click Behavior"
        default: "none"
        items:
          - label: "None - image is not clickable"
            value: "none"
          - label: "Enlarge - opens full-size in lightbox"
            value: "lightbox"
          - label: "Link - opens custom URL"
            value: "link"
        onChange: reload
        displayCond: "FIELD:zab_mediamixed_opt_type_media:=:media-image"
      - identifier: media_width
        type: Number
        label: "Width (px)"
        displayCond: "FIELD:zab_mediamixed_opt_type_media:=:media-image"
      - type: Linebreak
      - identifier: img_link
        type: Link
        label: "Link"
        displayCond: "FIELD:zab_mediamixed_opt_behavior:=:link"

  - identifier: text
    type: Textarea
    enableRichtext: true
