<?php

    return [
        "type"           => "page",
        "model"          => App\Models\GenericBackoffice\Entry::class,
        "label"          => "pages",
        "label_singular" => "page",
        "template"       => TRUE,
        "hierarchic"     => TRUE,
        "group"          => "content types",
        "order"          => TRUE,
        "showUri"        => 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|xss_clean",
                "validation"    => "",
            ],
            [
                "name"          => "blocks",
                "label"         => "Blocks",
                "type"          => "multiplePicker",
                "longList"      => true,
                "allowInsert"   => true,
                "objectTypes"   => ["blocks"],
                "order"         => true
            ],
            [
                "name"          => "password_protected",
                "label"         => "Password Protected",
                "type"          => "textBox",
                "maxLength"     => 150,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "max:150",
            ],
            [
                "name"          => "meta_title",
                "label"         => "[Meta] Title",
                "type"          => "textBox",
                "maxLength"     => 150,
                "multiLanguage" => TRUE,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "max:150",
                "placement"     => "sidebar",
                "inList"        => FALSE,
                "search"        => FALSE,
                "sort"          => FALSE
            ],
            [
                "name"          => "meta_description",
                "label"         => "[Meta] Description",
                "type"          => "textArea",
                "maxLength"     => 300,
                "multiLanguage" => TRUE,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "max:300",
                "placement"     => "sidebar",
                "inList"        => FALSE,
                "search"        => FALSE,
                "sort"          => FALSE
            ],
            [
                "name"      => "metaImage",
                "label"     => "[Meta] Image",
                "type"      => "mediaPicker",
                "multiple"  => FALSE,
                "mediaType" => "image",
                "placement" => "sidebar"
            ]
        ],
        "actions"        => [
            "insert", "edit", "delete", "order", "configuration"
        ],
        "templates"      => [
            'homepage' => [
                'id'   => 'homepage',
                'name' => 'Generic Page',
                'view' => 'frontend.pages.homepage'
            ],
        ]
    ];
