<?php

return [
    "type"           => "page",
    "model"          => App\Models\Backoffice\Page::class,
    "label"          => "content_types.page_plural",
    "label_singular" => "content_types.page_singular",
    "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"          => "content",
            "label"         => "content",
            "type"          => "editor",
            "multiLanguage" => TRUE,
            "preValidation" => "trim",
            "validation"    => ""
        ],
        /* [
            "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"      => [
        'blocks' => [
            'id'   => 'blocks',
            'name' => 'Blocks Page',
            'view' => 'frontend.pages.blocks'
        ],
    ]
];
