# You must use a tab-size of 4 spaces to edit this file.
---
plugin_settings:
    module_class_name: zenario_banner
    key:
        custom_command.prev_value: ''
    tabs:
        first_tab:
            edit_mode:
                format_on_edit: true
                format_on_cancel_edit: true
                format_on_revert: true
            label: 'Image & link'
            fields:
                #Previously, all the fields below were on the 2nd tab. As of 9.4, they are now on the first tab.
                image_source:
                    plugin_setting:
                        name: image_source
                    label: 'Select image for desktop browsers:'
                    type: select
                    value: _NO_IMAGE
                    values:
                        _NO_IMAGE:
                            label: "Don't show an image"
                        _CUSTOM_IMAGE:
                            label: "Show an image"
                        _STICKY_IMAGE:
                            label: "Show featured image from linked content item"
                    format_onchange: true

                image:
                    indent: 1
                    plugin_setting:
                        name: image
                        foreign_key_to: file
                        
                    label: 'Image for desktop browsers:'
                    pick_items:
                        path: zenario__library/panels/image_library
                        min_path: zenario__library/panels/image_library
                        max_path: zenario__library/panels/image_library
                        target_path: zenario__library/panels/image_library
                        select_phrase: Select image...
                    value: ""
                    format_onchange: true
                    upload:
                        multi: false
                        accept: 'image/png, image/jpeg, image/gif, image/webp'
                        extensions:
                            - .gif
                            - .jpg
                            - .jpeg
                            - .png
                            - .webp
                        drag_and_drop: true
                        reorder_items: false
                    validation:
                        required_if_not_hidden: Please select an image.
                canvas:
                    indent: 1
                    plugin_setting:
                        name: canvas
                    label: 'Image canvas:'
                    type: select
                    format_onchange: true
                    values:
                        crop_and_zoom:
                            label: Crop and zoom
                        fixed_width:
                            custom__label_raster: Constrain by width
                            custom__label_svg: Set width
                        fixed_height:
                            custom__label_raster: Constrain by height
                            custom__label_svg: Set height
                        fixed_width_and_height:
                            label: Constrain by width and height
                        unlimited:
                            ord: 99
                            custom__label_raster: Unlimited size
                            custom__label_svg: Use base width and height
                        
                        # A bit of a work-around here.
                        # We need a default value that changes, depending on whether the plugin is non-nested, or inside a nest.
                        # That's not tech we have, so we'll have a dummy default value, that we'll change to whatever it should be
                        # as soon as we see it in the PHP code.
                        DEFAULT:
                            hidden: true
                    value: DEFAULT
                retina:
                    indent: 2
                    plugin_setting:
                        name: retina
                    label: 'This is a retina image'
                    type: checkbox
                    same_row: true
                    value: ""
                    visible_if: |
                        !zenarioAB.svgSelected('image') &&
                        !zenarioAB.svgSelected('images')
                    side_note: |
                        Display image at double density.
                width:
                    indent: 2
                    plugin_setting:
                        name: width
                    label: 'Width:'
                    type: text
                    validation:
                        required_if_not_hidden: Please enter a width in pixels.
                        non_zero_number: Please enter a whole number greater than 0.
                        integer_number: Please enter a whole number greater than 0.
                        positive_number: Please enter a whole number greater than 0.
                    value: 600
                    maxlength: 5
                    style: 'width: 5em;'
                    post_field_html: '&nbsp;pixels'
                height:
                    indent: 2
                    plugin_setting:
                        name: height
                    label: 'Height:'
                    type: text
                    validation:
                        required_if_not_hidden: Please enter a height in pixels.
                        non_zero_number: Please enter a whole number greater than 0.
                        integer_number: Please enter a whole number greater than 0.
                        positive_number: Please enter a whole number greater than 0.
                    value: 400
                    maxlength: 5
                    style: 'width: 5em;'
                    post_field_html: '&nbsp;pixels'
                stretched_image_warning:
                    indent: 2
                    hidden: true
                    pre_field_html: "<div class=\"zenario_fbWarning\">"
                    snippet:
                        html: 'The image will be stretched, so quality will be degraded.'
                    post_field_html: "</div>"
                show_caption_on_image:
                    indent: 1
                    plugin_setting:
                        name: show_caption_on_image
                    label: "Show caption on thumbnail"
                    type: checkbox
                    hidden: true
                
                #Lazy loading doesn't support any other Mobile behaviour than "Same image".
                advanced_behaviour:
                    plugin_setting:
                        name: advanced_behaviour
                    label: 'Additional behaviour:'
                    indent: 1
                    type: select
                    format_onchange: true
                    values:
                        none:
                            label: 'None'
                        background_image:
                            label: 'Show as a background image'
                        use_rollover:
                            label: 'Use a rollover image'
                        lazy_load:
                            label: 'Lazy load image'
                    visible_if:
                        zenarioAB.valueIn: image_source, _CUSTOM_IMAGE, _STICKY_IMAGE
                
                rollover_image:
                    indent: 2
                    plugin_setting:
                        name: rollover_image
                        foreign_key_to: file
                    label: 'Change image on rollover:'
                    pick_items:
                        path: zenario__library/panels/image_library
                        min_path: zenario__library/panels/image_library
                        max_path: zenario__library/panels/image_library
                        target_path: zenario__library/panels/image_library
                        select_phrase: Select image...
                    value: ""
                    upload:
                        multi: false
                        accept: 'image/png, image/jpeg, image/gif, image/webp'
                        extensions:
                            - .gif
                            - .jpg
                            - .jpeg
                            - .png
                            - .webp
                        drag_and_drop: false
                        reorder_items: false
                rollover_tech:
                    indent: 2
                    plugin_setting:
                        name: rollover_tech
                        foreign_key_to: file
                    label: 'Rollover implementation:'
                    type: select
                    value: js
                    values:
                        js:
                            label: Mouseover and mouseout JavaScript events
                        css:
                            label: CSS :hover rule
                alt_tag:
                    indent: 1
                    plugin_setting:
                        name: alt_tag
                        translate: true
                    label: 'Overwrite image alt-tag:'
                    type: text
                    maxlength: 255
                    value: ""
                
                show_image_credit:
                    indent: 1
                    visible_if: |
                        zenarioAB.valueIn('image_source', '_CUSTOM_IMAGE', '_STICKY_IMAGE') ||
                        zenarioAB.valueIs('mobile_behaviour', 'mobile_change_image')
                    plugin_setting:
                        name: show_image_credit
                    label: 'Show image credit'
                    type: checkbox
                
                ######################################
                ###### Mobile behaviour options ######
                ######################################
                
                mobile_behaviour:
                    indent: 1
                    plugin_setting:
                        name: mobile_behaviour
                    label: 'Image for mobile browsers:'
                    type: select
                    format_onchange: true
                    values:
                        mobile_same_image:
                            custom__label_raster: 'Same image as for desktop'
                            custom__label_svg: 'Same image as for desktop'
                        mobile_same_image_different_size:
                            label: 'Same image, different size'
                        mobile_change_image:
                            label: 'Different image'
                        mobile_hide_image:
                            label: |
                                Don't show an image
                    value: mobile_same_image

                mobile_image:
                    plugin_setting:
                        name: mobile_image
                        foreign_key_to: file
                    label: 'Image for mobile browsers:'
                    pick_items:
                        path: zenario__library/panels/image_library
                        min_path: zenario__library/panels/image_library
                        max_path: zenario__library/panels/image_library
                        target_path: zenario__library/panels/image_library
                        select_phrase: Select mobile image...
                    value: ""
                    format_onchange: true
                    upload:
                        multi: false
                        accept: 'image/png, image/jpeg, image/gif, image/webp'
                        extensions:
                            - .gif
                            - .jpg
                            - .jpeg
                            - .png
                            - .webp
                        drag_and_drop: true
                        reorder_items: false
                    indent: 2
                mobile_canvas:
                    indent: 2
                    plugin_setting:
                        name: mobile_canvas
                    label: 'Mobile image canvas:'
                    type: select
                    format_onchange: true
                    value: crop_and_zoom
                    values:
                        crop_and_zoom:
                            label: Crop and zoom
                        fixed_width:
                            custom__label_raster: Constrain by width
                            custom__label_svg: Set width
                        fixed_height:
                            custom__label_raster: Constrain by height
                            custom__label_svg: Set height
                        fixed_width_and_height:
                            label: Constrain by width and height
                        unlimited:
                            ord: 99
                            custom__label_raster: Unlimited size
                            custom__label_svg: Use base width and height
                    
                mobile_retina:
                    indent: 3
                    plugin_setting:
                        name: mobile_retina
                    label: 'This is a retina image'
                    type: checkbox
                    same_row: true
                    value: ""
                    visible_if: |
                        !zenarioAB.svgSelected('mobile_image')
                    side_note: |
                        Display image at double density.
                mobile_width:
                    plugin_setting:
                        name: mobile_width
                    label: 'Width:'
                    type: text
                    validation:
                        required_if_not_hidden: Please enter a width.
                        non_zero_number: Please enter a whole number greater than 0.
                        integer_number: Please enter a whole number greater than 0.
                        positive_number: Please enter a whole number greater than 0.
                    value: 360
                    maxlength: 5
                    style: 'width: 5em;'
                    post_field_html: '&nbsp;pixels'
                    indent: 3
                mobile_height:
                    plugin_setting:
                        name: mobile_height
                    label: 'Height:'
                    type: text
                    validation:
                        required_if_not_hidden: Please enter a height.
                        non_zero_number: Please enter a whole number greater than 0.
                        integer_number: Please enter a whole number greater than 0.
                        positive_number: Please enter a whole number greater than 0.
                    value: 240
                    maxlength: 5
                    style: 'width: 5em;'
                    post_field_html: '&nbsp;pixels'
                    indent: 3
                
                ##########################
                ###### Link options ######
                ##########################
                
                link_type:
                    plugin_setting:
                        name: link_type
                    label: 'Link destination:'
                    type: select
                    value: _NO_LINK
                    values:
                        _NO_LINK:
                            label: |
                                Don't link
                        _CONTENT_ITEM:
                            label: Link to a content item
                        _DOCUMENT:
                            label: Link to a hierarchical document
                            #Only show the "Link to document" option for banners, and not anything that extends the banner
                            visible_if: |
                                tuix.key.moduleClassName == 'zenario_banner'
                        _EXTERNAL_URL:
                            label: Link to an external URL
                        _EMAIL:
                            label: Link to an email address
                        _ENLARGE_IMAGE:
                            label: Enlarge image in floating box
                            disabled_if: |
                                zenarioAB.value('image_source') != '_CUSTOM_IMAGE' ||
                                zenarioAB.svgSelected('image') || 
                                zenarioAB.svgSelected('images')
                        _CONDUCTOR_COMMAND:
                            visible_if: |
                                tuix.key.usesConductor
                            label: Issue a Conductor command to link to a slide in this Ajax Nest (advanced)
                    format_onchange: true
                
                custom_command:
                    visible_if: |
                        zenarioAB.value('link_type') == '_CONDUCTOR_COMMAND'
                    indent: 1
                    plugin_setting:
                        name: custom_command
                    type: text
                    format_onchange: true
                    maxlength: 100
                    label: 'Custom command name:'
                    placeholder: e.g. banner_link
                    validation:
                        required_if_not_hidden: |
                            Please enter a command name.
                        no_spaces: |
                            Please don't enter any spaces in the command's name.
                        screen_name: |
                            Please don't enter any special characters in the command's name.
                    note_below: |
                        <p>
                            Use this to allow a user to click the link in this banner and navigate to a different slide in a Conductor-based Ajax Nest.
                        </p><p>
                            When making a return link, enter &quot;<code>back</code>&quot;.
                        </p><p>
                            (If there are multiple banners on the same slide linking to different destination slides, the names need to be distinct.)
                        </p>
                to_state.custom_command:
                    indent: 1
                    #group_with_previous_field: true
                    hide_with_previous_field: true
                    hide_if_previous_value_is: ''
                    same_row: true
                    pre_field_html: ' - goes to&nbsp; '
                    type: select
                    empty_value: 'No path defined in conductor'
                    values: slides_and_states
                    show_as_a_label: true
                    css_class: zfab_conductor_button_destination
                
                floating_box_title_mode:
                    visible_if: "zenarioAB.value('link_type') == '_ENLARGE_IMAGE'"
                    indent: 1
                    plugin_setting:
                        name: floating_box_title_mode
                    type: radios
                    values: 
                        use_default: 
                            label: 'Use the image\'s default floating box caption ("")'
                            ord: 1
                        overwrite: 
                            label: 'Use custom floating box caption on this plugin'
                            ord: 2
                    value: "use_default"
                    format_onchange: true
                floating_box_title:
                    visible_if: |
                        zenarioAB.value('floating_box_title_mode') == 'overwrite'
                    indent: 2
                    plugin_setting:
                        name: floating_box_title
                        translate: true
                    label: 'Overwrite default floating box caption (may contain HTML):'
                    type: textarea
                    dont_trim: true
                    cols: 70
                    rows: 4
                    value: ""
                
                # Format the picker slightly differently when selecting a translation chain v.s selecting a content item.
                # Note: these are cosmetic changes only, for backwards compatibility reasons the values in the database and logic in the
                # PHP code is still exactly the same as it was in Zenario 9.4.
                hyperlink_target__specific:
                    hidden: true
                    pick_items: &hyperlink_target__specific__pick_items
                        path: zenario__content/panels/content/refiners/filter_by_lang////
                        min_path: zenario__content/panels/content
                        max_path: zenario__content/panels/content
                        target_path: zenario__content/panels/content
                        select_phrase: Select a content item...
                        hide_remove_button: true
                    validation: &hyperlink_target__specific__validation
                        required_if_not_hidden: Please select a content item
                hyperlink_target__translation:
                    hidden: true
                    pick_items:
                        path: zenario__content/panels/translation_chains
                        min_path: zenario__content/panels/translation_chains
                        max_path: zenario__content/panels/translation_chains
                        target_path: zenario__content/panels/translation_chains
                        select_phrase: Select a translation chain...
                        hide_remove_button: true
                    validation:
                        required_if_not_hidden: Please select a translation chain
                
                use_translation:
                    indent: 1
                    plugin_setting:
                        name: use_translation
                    type: radios
                    value: 0
                    values:
                        0:
                            ord: 1
                            label: 'Link to a content item in a specific language:'
                        1:
                            ord: 0
                            label: "Link to a translation chain, to show a content item in the visitor's language (recommended):"
                    format_onchange: true
                hyperlink_target:
                    indent: 1
                    plugin_setting:
                        name: hyperlink_target
                        foreign_key_to: content
                    pick_items: *hyperlink_target__specific__pick_items
                    validation: *hyperlink_target__specific__validation
                    format_onchange: true
                    notices_below:
                        in_language:
                            hidden: true
                            type: information
                            message: ''
                        featured_image_filename:
                            hidden: true
                            type: ''
                            message: ''
                
                hide_private_item:
                    indent: 1
                    plugin_setting:
                        name: hide_private_item
                    label: 'Privacy:'
                    type: select
                    #note_below: controlled in formatAdminBox
                    value: _ALWAYS_SHOW
                    values:
                        _ALWAYS_SHOW:
                            ord: 1
                            label: Show to visitors and extranet users, even if the target content item is private
                        _PRIVATE:
                            ord: 2
                            label: Obey the privacy setting of the content item
                        _LOGGED_OUT:
                            ord: 3
                            label: Show to visitors, hide from extranet users
                        _LOGGED_IN:
                            ord: 4
                            label: Only show to extranet users
                use_download_page:
                    indent: 1
                    plugin_setting:
                        name: use_download_page
                    label: 'Use a download page'
                    type: checkbox
                    value: ""
                    side_note: |
                        Link to the file's download page, rather than a direct link to the file.
                        Note that this option only applies to document content items.
                    hidden: true
                add_referrer:
                    indent: 1
                    plugin_setting:
                        name: add_referrer
                    label: "Add the current content item's ID as a referrer code in the URL"
                    type: checkbox
                    value: ""
                    side_note: |
                        This will add a string in the format <code>referrer=html_123</code> to
                        the link. Plugins on the destination page may check this to see which content
                        item the visitor just came from.
                    hidden: true
                url:
                    indent: 1
                    plugin_setting:
                        name: url
                    label: 'External URL:'
                    type: url
                    maxlength: 255
                    value: ""
                    validation:
                        required_if_not_hidden: "Please enter a URL."
                email_address:
                    indent: 1
                    plugin_setting:
                        name: email_address
                    label: "Email address:"
                    type: text
                    placeholder: "mailto:example@email.com"
                    onblur: "if (this.value && !this.value.match('mailto:')) {this.value = 'mailto:' + this.value;}"
                    maxlength: 255
                    value: ""
                    validation:
                        required_if_not_hidden: "Please enter an email address."
                test_send_email:
                    type: button
                    value: "Test"
                    same_row: true
                    hide_with_previous_field: true
                    onclick: "var email_address = lib.get('email_address'); if (email_address) {var popup = window.open(email_address.value); setTimeout(function() { popup.close() }, 500);;}"
                target_blank:
                    indent: 1
                    plugin_setting:
                        name: target_blank
                    type: select
                    empty_value: 'Open in the same window'
                    values:
                        1:
                            label: Open in a new window
                        2:
                            label: Open in a floating box
                    value: ""
                link_to_anchor:
                    indent: 1
                    plugin_setting:
                        name: link_to_anchor
                    label: Link to anchor
                    type: checkbox
                    visible_if: |
                        zenarioAB.value('link_type') == '_CONTENT_ITEM'
                    redraw_onchange: true
                hyperlink_anchor:
                    indent: 2
                    plugin_setting:
                        name: hyperlink_anchor
                    label: 'Anchor name:'
                    type: text
                    maxlength: 255
                    visible_if: |
                        zenarioAB.value('link_type') == '_CONTENT_ITEM' && zenarioAB.value('link_to_anchor')
                    validation:
                        required_if_not_hidden: Please enter an anchor name.
                        anchor_tag: 'Anchor tags may not contain spaces or any of the following: #%^[]{}\"<>`\''
                    side_note: >
                        If you have an anchor on the page, you can specify it here and you'll be
                        taken to its location on navigation.
                document_id:
                    plugin_setting:
                        name: document_id
                        foreign_key_to: document
                    indent: 1
                    format_onchange: true
                    label: 'Hierarchical document:'
                    visible_if: |
                        zenarioAB.value('link_type') == '_DOCUMENT'
                    pick_items:
                        path: zenario__library/panels/documents
                        min_path: zenario__library/panels/documents
                        max_path: zenario__library/panels/documents
                        target_path: zenario__library/panels/documents
                        select_phrase: Select a hierarchical document...
                        disabled_if_for_all_selected_items: |
                            item && item.type == 'folder'
                privacy_warning:
                    plugin_setting:
                        name: privacy_warning
                    #note_below: Controlled in module_code.php
                    indent: 1
                    same_row: true
                    visible_if: zenarioAB.value('link_type') == '_DOCUMENT'
                more_link_text:
                    plugin_setting:
                        name: more_link_text
                        is_searchable_content: true
                        translate: true
                    indent: 1
                    label: |
                        Text for "More info" link:
                    type: text
                    width: 150
                    maxlength: 255
                    value: ""
                
                
                enlarge_canvas:
                    indent: 1
                    plugin_setting:
                        name: enlarge_canvas
                    label: 'Enlarged image canvas:'
                    type: select
                    value: unlimited
                    values:
                        unlimited:
                            label: Unlimited size
                        fixed_width:
                            label: Constrain by width
                        fixed_height:
                            label: Constrain by height
                        fixed_width_and_height:
                            label: Constrain by width and height
                    format_onchange: true
                enlarge_width:
                    indent: 2
                    plugin_setting:
                        name: enlarge_width
                    label: 'Width:'
                    type: text
                    validation:
                        required_if_not_hidden: Please enter an enlarged width.
                        non_zero_number: Please enter a whole number greater than 0.
                        integer_number: Please enter a whole number greater than 0.
                        positive_number: Please enter a whole number greater than 0.
                    value: ""
                    maxlength: 5
                    style: 'width: 5em;'
                    post_field_html: '&nbsp;pixels'
                enlarge_height:
                    indent: 2
                    plugin_setting:
                        name: enlarge_height
                    label: 'Height:'
                    type: text
                    validation:
                        required_if_not_hidden: Please enter an enlarged height.
                        non_zero_number: Please enter a whole number greater than 0.
                        integer_number: Please enter a whole number greater than 0.
                        positive_number: Please enter a whole number greater than 0.
                    value: ""
                    maxlength: 5
                    style: 'width: 5em;'
                    post_field_html: '&nbsp;pixels'
                show_caption_on_enlarged_image:
                    indent: 1
                    plugin_setting:
                        name: show_caption_on_enlarged_image
                    label: "Show caption on enlarged image"
                    type: checkbox
                    hidden: true
            
        title_and_description:
            label: 'Title & description'
            fields:
                title:
                    plugin_setting:
                        name: title
                        is_searchable_content: true
                        translate: true
                    label: 'Title:'
                    type: text
                    width: 150
                    maxlength: 255
                    value: ""
                
                title_tags:
                    plugin_setting:
                        name: title_tags
                    label: 'Title HTML tags:'
                    type: select
                    values:
                        h1: <h1>
                        h2: <h2>
                        h3: <h3>
                        h4: <h4>
                        h5: <h5>
                        h6: <h6>
                        p: <p>
                    value: h2
                    same_row: true
                
                set_an_anchor:
                    plugin_setting:
                        name: set_an_anchor
                    label: 'Set an anchor'
                    type: checkbox
                    value: false
                    format_onchange: true
                anchor_name:
                    plugin_setting:
                        name: anchor_name
                    indent: 1
                    type: text
                    label: 'Anchor name:'
                    visible_if: zenarioAB.value('set_an_anchor')
                    validation:
                        required_if_not_hidden: 'Please enter the anchor name.'
                        anchor_tag: 'Anchor tags may not contain spaces or any of the following: #%^[]{}\"<>`\''
                    #This field has an oninput event, set in the fillAdminBox method,
                    #and a side_note, set in the formatAdminBox method.
                
                text:
                    plugin_setting:
                        name: text
                        is_searchable_content: true
                        translate: true
                    label: 'Description (HTML):'
                    type: editor
                    editor_type: description_editor
                    dont_trim: true
                    cols: 80
                    rows: 10
                    value: ""