66 lines
1.2 KiB
TypeScript
66 lines
1.2 KiB
TypeScript
import type { CollectionConfig } from 'payload'
|
|
import { isAdminOrEmployee } from '@/collections/access/admin'
|
|
|
|
export const Media: CollectionConfig = {
|
|
slug: 'media',
|
|
access: {
|
|
read: () => true,
|
|
update: isAdminOrEmployee(),
|
|
delete: isAdminOrEmployee()
|
|
},
|
|
admin: {
|
|
listSearchableFields: ['search']
|
|
},
|
|
labels: {
|
|
singular: {
|
|
de: "Bild"
|
|
},
|
|
plural: {
|
|
de: "Bilder"
|
|
}
|
|
},
|
|
fields: [
|
|
{
|
|
name: 'alt',
|
|
type: 'text',
|
|
label: 'Kurze Beschreibung für u.a. Sehbhinderte Menschen',
|
|
required: true,
|
|
},
|
|
{
|
|
name: 'search',
|
|
type: 'text',
|
|
label: {
|
|
de: "Suchbegriffe"
|
|
}
|
|
}
|
|
],
|
|
upload: {
|
|
imageSizes: [
|
|
{
|
|
name: 'thumbnail',
|
|
width: 350,
|
|
height: 350,
|
|
position: 'centre',
|
|
},
|
|
{
|
|
name: 'banner',
|
|
width: 1100,
|
|
height: 400,
|
|
position: 'centre',
|
|
},
|
|
{
|
|
name: 'gallery',
|
|
height: 500,
|
|
width: undefined,
|
|
position: 'centre',
|
|
},
|
|
{
|
|
name: 'tablet',
|
|
width: 1024,
|
|
height: undefined,
|
|
position: 'centre',
|
|
},
|
|
],
|
|
mimeTypes: ['image/*'],
|
|
},
|
|
}
|