tabs:
  main:
    display: Main
    sections:
      -
        fields:
          -
            handle: is_root
            field:
              type: toggle
              display: Root
              localizable: false
              width: 33
          -
            handle: add_horizontal_rule
            field:
              type: toggle
              display: 'Add horizontal rule'
              instructions: 'Select if a horizontal rule should be added underneath this navigation item to signify the end of a section in the nav.'
              localizable: false
              if:
                is_root: 'equals false'
              width: 33
          -
            handle: include_subpage
            field:
              type: toggle
              display: 'Include subpage'
              localizable: false
              if:
                is_root: 'equals true'
              width: 33
          -
            handle: nav_title
            field:
              type: text
              display: 'Navigation title'
              localizable: false
              listable: true
              instructions: 'Overwrite the title to be displayed in the nav'
              if:
                is_root: 'equals false'
          -
            handle: nav_description
            field:
              type: textarea
              display: 'Navigation description'
              localizable: false
              instructions: 'Optional description of the navigation option'
              if:
                is_root: 'equals false'
      -
        display: 'Subpage fields'
        fields:
          -
            handle: subpage_link
            field:
              type: text
              display: 'Subpage link'
              localizable: false
              validate:
                - sometimes
                - 'required_if:include_subpage,true'
              if:
                include_subpage: 'equals true'
          -
            handle: subpage_title
            field:
              type: text
              display: 'Subpage title'
              localizable: false
              validate:
                - sometimes
                - 'required_if:include_subpage,true'
              instructions: "Field to be used as the title on the navigation subpage. If linked to an entry, the entry's title will be used if this field is blank."
              if:
                include_subpage: 'equals true'
          -
            handle: subpage_description
            field:
              type: text
              display: 'Subpage description'
              localizable: false
              validate:
                - sometimes
                - 'required_if:include_subpage,true'
              if:
                include_subpage: 'equals true'
          -
            handle: subpage_image
            field:
              container: assets
              type: assets
              display: 'Subpage image'
              localizable: false
              max_files: 1
              validate:
                - sometimes
                - 'required_if:include_subpage,true'
              if:
                include_subpage: 'equals true'
