Use filename as title for media
This commit is contained in:
parent
b0416b61db
commit
1092c97f5d
|
@ -31,6 +31,7 @@ export const Audios = buildCollectionConfig({
|
||||||
admin: {
|
admin: {
|
||||||
group: CollectionGroups.Media,
|
group: CollectionGroups.Media,
|
||||||
preview: ({ id }) => `${process.env.PAYLOAD_PUBLIC_FRONTEND_BASE_URL}/en/audios/${id}`,
|
preview: ({ id }) => `${process.env.PAYLOAD_PUBLIC_FRONTEND_BASE_URL}/en/audios/${id}`,
|
||||||
|
useAsTitle: fields.filename,
|
||||||
defaultColumns: [
|
defaultColumns: [
|
||||||
fields.filename,
|
fields.filename,
|
||||||
fields.thumbnail,
|
fields.thumbnail,
|
||||||
|
|
|
@ -36,6 +36,7 @@ export const Images = buildImageCollectionConfig({
|
||||||
admin: {
|
admin: {
|
||||||
preview: ({ id }) => `${process.env.PAYLOAD_PUBLIC_FRONTEND_BASE_URL}/en/images/${id}`,
|
preview: ({ id }) => `${process.env.PAYLOAD_PUBLIC_FRONTEND_BASE_URL}/en/images/${id}`,
|
||||||
defaultColumns: [fields.filename, fields.posts, fields.updatedAt],
|
defaultColumns: [fields.filename, fields.posts, fields.updatedAt],
|
||||||
|
useAsTitle: fields.filename,
|
||||||
},
|
},
|
||||||
upload: {
|
upload: {
|
||||||
imageSizes: [
|
imageSizes: [
|
||||||
|
|
|
@ -17,6 +17,7 @@ export const Scans = buildImageCollectionConfig({
|
||||||
plural: "Scans",
|
plural: "Scans",
|
||||||
},
|
},
|
||||||
admin: {
|
admin: {
|
||||||
|
useAsTitle: fields.filename,
|
||||||
defaultColumns: [fields.filename, fields.updatedAt],
|
defaultColumns: [fields.filename, fields.updatedAt],
|
||||||
hidden: shownOnlyToAdmin,
|
hidden: shownOnlyToAdmin,
|
||||||
},
|
},
|
||||||
|
|
|
@ -40,6 +40,7 @@ export const Videos = buildCollectionConfig({
|
||||||
labels: { singular: "Video", plural: "Videos" },
|
labels: { singular: "Video", plural: "Videos" },
|
||||||
defaultSort: fields.filename,
|
defaultSort: fields.filename,
|
||||||
admin: {
|
admin: {
|
||||||
|
useAsTitle: fields.filename,
|
||||||
group: CollectionGroups.Media,
|
group: CollectionGroups.Media,
|
||||||
preview: ({ id }) => `${process.env.PAYLOAD_PUBLIC_FRONTEND_BASE_URL}/en/videos/${id}`,
|
preview: ({ id }) => `${process.env.PAYLOAD_PUBLIC_FRONTEND_BASE_URL}/en/videos/${id}`,
|
||||||
defaultColumns: [
|
defaultColumns: [
|
||||||
|
|
|
@ -5,7 +5,12 @@ import { buildCollectionConfig } from "../../utils/collectionConfig";
|
||||||
export const VideosSubtitles = buildCollectionConfig({
|
export const VideosSubtitles = buildCollectionConfig({
|
||||||
slug: Collections.VideosSubtitles,
|
slug: Collections.VideosSubtitles,
|
||||||
labels: { singular: "Video Subtitle", plural: "Videos Subtitles" },
|
labels: { singular: "Video Subtitle", plural: "Videos Subtitles" },
|
||||||
admin: { group: CollectionGroups.Media, disableDuplicate: true, hidden: shownOnlyToAdmin },
|
admin: {
|
||||||
|
useAsTitle: "filename",
|
||||||
|
group: CollectionGroups.Media,
|
||||||
|
disableDuplicate: true,
|
||||||
|
hidden: shownOnlyToAdmin,
|
||||||
|
},
|
||||||
upload: {
|
upload: {
|
||||||
mimeTypes: ["text/*"],
|
mimeTypes: ["text/*"],
|
||||||
disableLocalStorage: true,
|
disableLocalStorage: true,
|
||||||
|
|
Loading…
Reference in New Issue