2023-05-29 16:22:34 +02:00
import { DateFormat , MarkdownProps } from "../props.js" ;
import { DescriptionText , DraftBoolean , Title } from "./widgets.js" ;
const BlogCollection = {
name : "blog" ,
label : "Aktuelles" ,
label _singular : "Artikel" ,
description :
'Diese Artikel werden im Bereich "Aktuelles" auf der Schulhomepage angezeigt. Sie können sowohl direkt veröffentlicht, als auch als Entwurf gespeichert werden.' ,
icon : "news" ,
2023-06-21 17:58:49 +02:00
folder : "content/blog" ,
2023-05-29 16:22:34 +02:00
create : true ,
editor : {
preview : true ,
frame : true ,
size : "half" ,
} ,
filter : {
field : "type" ,
value : "post" ,
} ,
view _groups : [
{
label : "Entwurf" ,
field : "draft" ,
} ,
] ,
sortable _fields : {
fields : [ "date" , "title" ] ,
default : {
field : "date" ,
direction : "Descending" ,
} ,
} ,
summary _fields : [ "date" , "title" , "draft" , "author" , "body" ] ,
fields : [
Title ( false ) ,
{
name : "date" ,
label : "Datum" ,
widget : "datetime" ,
required : true ,
... DateFormat ,
} ,
DraftBoolean ,
DescriptionText ,
{
name : "image" ,
label : "Titelbild" ,
2023-06-25 22:52:40 +02:00
hint : "16:9 Seitenverhältnis beachten" ,
2023-05-29 16:22:34 +02:00
widget : "image" ,
required : true ,
default : "/media/image.webp" ,
} ,
{
name : "author" ,
label : "Autor(en)" ,
hint : "Verwaltet im Autoren-Bereich. Mehrere Autoren werden in alphabetischer Reihenfolge aufgelistet." ,
widget : "relation" ,
collection : "author" ,
value _field : "{{slug}}" ,
2023-09-19 17:20:59 +02:00
search _fields : [ "title" ] ,
2023-05-29 16:22:34 +02:00
display _fields : [ "{{title}}" ] ,
multiple : true ,
required : true ,
2023-07-06 22:05:04 +02:00
options _length : 10000 ,
2023-05-29 16:22:34 +02:00
} ,
{
name : "categories" ,
label : "Kategorien" ,
hint : "Verwaltet in den Einstellungen" ,
widget : "relation" ,
collection : "settings" ,
file : "data-categories" ,
value _field : "blog.*" ,
search _fields : [ "blog.*" ] ,
display _fields : [ "blog.*" ] ,
multiple : true ,
required : true ,
2023-07-06 22:05:04 +02:00
options _length : 10000 ,
2023-05-29 16:22:34 +02:00
} ,
{
name : "subjects" ,
label : "Fächer" ,
hint : "Verwaltet in den Einstellungen" ,
widget : "relation" ,
collection : "settings" ,
file : "data-categories" ,
value _field : "subjects.*" ,
search _fields : [ "subjects.*" ] ,
display _fields : [ "subjects.*" ] ,
multiple : true ,
2023-06-30 10:03:57 +02:00
required : false ,
2023-07-06 22:05:04 +02:00
options _length : 10000 ,
2023-05-29 16:22:34 +02:00
} ,
{
name : "tags" ,
label : "Tags" ,
widget : "list" ,
delimiter : "," ,
2023-09-19 17:20:59 +02:00
required : false
2023-05-29 16:22:34 +02:00
} ,
{
name : "type" ,
label : "Typ" ,
widget : "hidden" ,
default : "post" ,
} ,
{
name : "body" ,
label : "Inhalt" ,
widget : "markdown" ,
required : true ,
... MarkdownProps ,
} ,
] ,
} ;
export default BlogCollection ;