<?php

    return [
        "type"           => "page",
        "model"          => "Entry",
        "label"          => "pages",
        "label_singular" => "page",
        "template"       => TRUE,
        "hierarchic"     => TRUE,
        "group"          => "general",
        "order"          => TRUE,
        //  "showSlug" => true,
        "showUri"        => TRUE,
        "search"         => [
            "primary"   => ["title"],
            "secondary" => ["content"],
            "display"   => [
                "title"   => "title",
                "content" => "content"
            ]
        ],
        "fields"         => [
            [
                "name"          => "title",
                "label"         => "Título",
                "type"          => "textBox",
                "maxLength"     => 150,
                "multiLanguage" => TRUE,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "required|max:150",
                "inList"        => TRUE,
                "search"        => TRUE,
                "sort"          => TRUE
            ],
            [
                "name"          => "header_template",
                "label"         => "Header - Cabeçalho",
                "type"          => "selectBox",
                "list"          => [
                    "home"              => "Home",
                    "sust_simulator"    => "Simulador da Sustentabilidade",
                    "pension_simulator" => "Simulador de Pensões",
                    "none"              => "Sem Header"
                ],
                "preValidation" => "trim",
                "placement"     => "sidebar",
                "validation"    => "required",
            ],
            [
                "name"          => "content",
                "label"         => "content",
                "type"          => "editor",
                "multiLanguage" => TRUE,
                "preValidation" => "trim|xss_clean",
                "validation"    => ""
            ],
            [
                "name"        => "pageSections",
                "label"       => "Secções de Página",
                "type"        => "multiplePicker",
                "objectTypes" => ["page_section"],
                "order"       => TRUE
            ],
            [
                "name"        => "archives",
                "label"       => "Biblioteca",
                "type"        => "multiplePicker",
                "objectTypes" => ["archive"],
                "order"       => TRUE
            ],
            [
                "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"
        ],
        "templates"      => [
            'homepage' => [
                'id'   => 'homepage',
                'name' => 'Home Page',
                'view' => 'frontend.pages.homepage'
            ]
        ]
    ];

