<?php

return [
    "type"           => "page",
    "model"          => App\Models\Backoffice\Page::class,
    "label"          => "pages",
    "label_singular" => "page",
    "template"       => TRUE,
    "hierarchic"     => TRUE,
    "group"          => "content",
    "order"          => TRUE,
    //"meta_title_update_field" => "title", // content_types should have this property to allow automatic filling of meta info, if not set by user (See BackofficeService::240)
    //  "showSlug" => true,
    "showUri"        => TRUE,
    "isPage"         => TRUE,
    "search"         => [
        "title" => "title",
        "fields" => [
            "title",
            "content",
        ],
        "relations" => [
            "blocks"
        ],
    ],
    "fields"         => [
        [
            "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
        ],
        [
            "name"          => "subtitle",
            "label"         => "Subtitle",
            "type"          => "textBox",
            "maxLength"     => 250,
            "multiLanguage" => TRUE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "max:250",
            "search"        => TRUE,
        ],
        [
            "name"          => "content",
            "label"         => "content",
            "type"          => "editor",
            "multiLanguage" => TRUE,
            "preValidation" => "trim",
            "validation"    => ""
        ],
        [
            "name"          => "image",
            "label"         => "Image",
            "type"          => "mediaPicker",
            "multiple"      => FALSE,
            "mediaType"     => "image",
        ],
        // [
        //     "name" => "repeaterBlocks",
        //     "label" => "Repeater Blocks",
        //     "type" => "repeater",
        //     "objectType" => "repeater_block",
        //     "order" => true,
        //     "maxSize"   => 6
        // ],
        // [
        //     "name"          => "blocks",
        //     "label"         => "Blocks",
        //     "type"          => "multiplePicker",
        //     "allowInsert"   => true,
        //     "objectTypes"   => ["block"],
        //     "order"         => true
        // ],
        /*
        [
            "name"          => "meta_title",
            "label"         => "[Meta] Title",
            "type"          => "textBox",
            "maxLength"     => 150,
            "multiLanguage" => TRUE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "max:150",
            "inList"        => FALSE,
            "search"        => FALSE,
            "sort"          => FALSE
        ],
        [
            "name"          => "meta_description",
            "label"         => "[Meta] Description",
            "type"          => "textArea",
            "maxLength"     => 300,
            "height"        => 'small',
            "multiLanguage" => TRUE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "max:300",
            "inList"        => FALSE,
            "search"        => FALSE,
            "sort"          => FALSE
        ],
        [
            "name"      => "metaImage",
            "label"     => "[Meta] Image",
            "type"      => "mediaPicker",
            "multiple"  => FALSE,
            "mediaType" => "image",
            "placement" => "sidebar"
        ]
        */
    ],
    "actions"        => [
        "edit", "delete", "order", "insert", "configuration"
    ],
    "templates"      => [
        'page' => [
            'id'   => 'page',
            'name' => 'Page',
            'view' => 'frontend.pages.page'
        ]
    ]
];
