<?php
return array(
    "type" => "blog_post",
    "model" => "App\Models\BlogPost",
    "label" => "Blog Posts",
    "label_singular" => "Blog Post",
    "group" => "blog",
    "template" => false,
    "order" => false,
    "baseUri" => array(
        1 => array(
            "en" => "/blog",
            "de" => "/blog",
            "sv" => "/blog",
            "fr" => "/blog",
            "es" => "/blog",
            "pt" => "/blog"
        )
    ),
    "search" => array(
        1 => array(
            "primary" => array("title"),
            "secondary" => array("excerpt", "content"),
            "display" => array(
                "title" => "title",
                "content" => "reference_summary|excerpt",
                "image_id" => "media"
            ),
            "relations" => [
                "blocks",
                "authors"
            ],
        )
    ),
    "fields" => array(
        array(
            "name" => "title",
            "label" => "title",
            "type" => "textBox",
            "maxLength" => 150,
            "multiLanguage" => true,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "required|max:150",
            "inList" => true,
            "search" => true,
            "sort" => true
        ),
        array(
            "name" => "reading_info",
            "label" => "Reading Info",
            "type" => "textBox",
            "maxLength" => 50,
            "multiLanguage" => true,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "max:50",
            "info" => "Ex: 5m read"
        ),
        array(
            "name" => "image_caption",
            "label" => "Hero Image Caption / Credit",
            "type" => "textBox",
            "maxLength" => 255,
            "multiLanguage" => true,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "max:255"
        ),
        array(
            "name" => "reference_summary",
            "label" => "Reference Summary",
            "type" => "textBox",
            "maxLength" => 220,
            "multiLanguage" => true,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "max:220"
        ),
        array(
            "name" => "layout_type",
            "label" => "Layout Type",
            "type" => "selectBox",
            "list" => array(
                "standard" => "Standard",
                "blocks" => "Blocks"
            ),
            "preValidation" => "trim",
            "validation" => "nullable|in:standard,blocks",
            "placement" => "sidebar",
            "inList" => true,
            "search" => true,
            "sort" => true
        ),
        array(
            "name" => "header_overlap",
            "label" => "Header overlaps content?",
            "type" => "checkBox",
            "placement" => "sidebar",
            "blocksMode" => "also",
            "parent" => array(
                "name" => "layout_type",
                "values" => array("blocks")
            )
        ),
        array(
            "name" => "excerpt",
            "label" => "Excerpt",
            "type" => "textArea",
            "multiLanguage" => true,
            "preValidation" => "trim|xss_clean",
            "validation" => "",
        ),
        array(
            "name" => "content",
            "label" => "content",
            "type" => "editor",
            "multiLanguage" => true,
            "preValidation" => "trim",
            "validation" => "",
            "parent" => array(
                "name" => "layout_type",
                "values" => array("standard", "")
            )
        ),
        array(
            "name"          => "blocks",
            "label"         => "Blocks",
            "type"          => "multiplePicker",
            "longList"      => true,
            "multiLanguage" => true,
            "allowInsert"   => true,
            "objectTypes"   => ["block"],
            "order"         => true,
            "blocksMode" => "also",
            "duplicateRelated" => true,
            "parent" => array(
                "name" => "layout_type",
                "values" => array("blocks")
            )
        ),
        array(
            "name" => "date",
            "label" => "date",
            "type" => "datePicker",
            "inputType" => "date", //time|date|datetime
            "multiLanguage" => false,
            "validation" => "required",
            "placement" => "sidebar",
            "inList" => true,
            "search" => true,
            "sort" => true
        ),
        array(
            "name" => "type",
            "label" => "Post Type",
            "type" => "selectBox",
            "list" => array(
                "regular" => "Regular Post",
                "interview" => "Q&A's Post"
            ),
            "placement" => "sidebar",
            "preValidation" => "trim",
            "defaultValue" => 'regular',
            "validation" => "required|in:regular,interview",
            "info" => "IMPORTANT!: If you choose Q&A's you'll have to save the post before you see and are able to insert the Q&A's (it will appear in the end of the page)"
        ),
        array(
            "name" => "sidebarWidgets",
            "label" => "Sidebar Widgets",
            "type" => "singlePicker",
            "objectType" => "sidebar_widget",
            "pivotTable" => "blog_post_sb_widgets",
            "order" => true,
            "maxSize" => 20,
            "parent" => array(
                "name" => "layout_type",
                "values" => array("standard", "")
            )
        ),
        array(
            "name" => "is_feature_post",
            "label" => "Feature Post?",
            "type" => "checkBox",
            "placement" => "sidebar"
        ),
        array(
            "name" => "hide_newsletter",
            "label" => "Hide Newsletter box?",
            "type" => "checkBox",
            "placement" => "sidebar",
            "parent" => array(
                "name" => "layout_type",
                "values" => array("standard", "")
            )
        ),
        array(
            "name" => "media",
            "label" => "cover media",
            "type" => "mediaPicker",
            "multiLanguage" => false,
            "mediaType" => "image",
            "placement" => "sidebar",
            "multiple" => false,
            "minSize" => "1",
            /*
            "thumbnailSizes" => array(
                array("type" => "fit", "name" => "280x150", "width" => 280, "height" => 150),
                array("type" => "fit", "name" => "800x800", "width" => 800, "height" => 800),
                array("type" => "resize_noup", "name" => "800w", "width" => 800, "height" => 800),
            ),
            */
            "relatedContentType" => 'blog_post'
        ),
        array(
            "name" => "categories",
            "label" => "Categories",
            "type" => "multiplePicker",
            "objectTypes" => array("blog_category"),
            "order" => true,
            "maxSize" => 10
        ),
        array(
            "name" => "tags",
            "label" => "Tags",
            "type" => "tags",
            "objectTypes" => array("blog_tag"),
            "order" => true,
            "maxSize" => 30
        ),
        array(
            "name" => "authors",
            "label" => "Authors",
            "type" => "multiplePicker",
            "objectTypes" => array("blog_author"),
            "order" => true,
            "maxSize" => 3
        ),
        array(
            "name" => "interviewed_1",
            "label" => "Interviewed 1",
            "type" => "textBox",
            "maxLength" => 45,
            "multiLanguage" => false,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "nullable|required_if:type,interview|max:45",
            "info" => "This will show full in the first answer, and abreviated in all others.",
            "parent" => array(
                "name" => "type",
                "values" => array("interview")
            )
        ),
        array(
            "name" => "interviewed_2",
            "label" => "Interviewed 2",
            "type" => "textBox",
            "maxLength" => 45,
            "multiLanguage" => false,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "max:45",
            "info" => "This will show full in the first answer, and abreviated in all others.",
            "parent" => array(
                "name" => "type",
                "values" => array("interview")
            )
        ),
        array(
            "name" => "interviewed_3",
            "label" => "Interviewed 3",
            "type" => "textBox",
            "maxLength" => 45,
            "multiLanguage" => false,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "max:45",
            "info" => "This will show full in the first answer, and abreviated in all others.",
            "parent" => array(
                "name" => "type",
                "values" => array("interview")
            )
        ),
        array(
            "name" => "questions",
            "label" => "Questions & Answers",
            "type" => "singlePicker",
            "objectType" => "blog_question",
            "order" => true,
            "parent" => array(
                "name" => "type",
                "values" => array("interview")
            )
        ),
        array(
            "name" => "relatedPosts",
            "label" => "Related Posts",
            "type" => "multiplePicker",
            "objectTypes" => array("blog_post"),
            "order" => true,
            "maxSize" => 3
        ),
        array(
            "name" => "meta_title",
            "label" => "SEO - Title Tag",
            "type" => "textBox",
            "maxLength" => 150,
            "multiLanguage" => true,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "max:150"
        ),
        array(
            "name" => "meta_keywords",
            "label" => "SEO - Keywords",
            "type" => "textBox",
            "maxLength" => 150,
            "multiLanguage" => true,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "max:150"
        ),
        array(
            "name" => "meta_description",
            "label" => "SEO - Description",
            "type" => "textArea",
            "maxLength" => 300,
            "multiLanguage" => true,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "max:300"
        ),
        array(
            "name" => "canonical_url",
            "label" => "Canonical URL (original source of the content)",
            "type" => "textBox",
            "maxLength" => 255,
            "multiLanguage" => false,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "nullable|url|max:255"
        ),
        array(
            "name" => "cta_bar_type",
            "label" => "CTA bottom bar type",
            "type" => "selectBox",
            "list" => array(
                "regular" => "Title, subtitle and cta",
                "contact" => "Contact"
            ),
            "preValidation" => "trim",
            "defaultValue" => 'regular',
            "validation" => "nullable|in:regular,contact"
        ),
        array(
            "name" => "cta_bar_title",
            "label" => "CTA Bar title",
            "type" => "textBox",
            "maxLength" => 150,
            "multiLanguage" => true,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "max:150",
            "parent" => array(
                "name" => "cta_bar_type",
                "values" => array("regular")
            )
        ),
        array(
            "name" => "cta_bar_contact_id",
            "label" => "CTA Bar Contact",
            "type" => "selectBox",
            "contentType" => "contact",
            "dropdownSortField" => "contacts.name",
            "labelField" => "name",
            "validation" => "nullable|required_if:cta_bar_type,contact|integer|min:1",
            "parent" => array(
                "name" => "cta_bar_type",
                "values" => array("contact")
            )
        ),
        array(
            "name" => "cta_bar_text",
            "label" => "CTA Bar subtitle / contact testimonial",
            "type" => "textBox",
            "maxLength" => 255,
            "multiLanguage" => true,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation" => "max:255",
            "parent" => array(
                "name" => "cta_bar_type",
                "values" => array("regular", "contact")
            )
        ),
        array(
            "name" => "cta_bar_cta",
            "label" => "CTA Bar button",
            "type" => "link",
            "multiLanguage" => true,
            "required" => false,
            "maxLabel" => 40,
            "objectTypes" => [],
            "parent" => array(
                "name" => "cta_bar_type",
                "values" => array("regular")
            )
        ),
    ),
    "actions" => array(
        "insert", "edit", "delete", "duplicate"
    )
);
