From 126395746ea858a2aa7a36b08f29ccde637f21d5 Mon Sep 17 00:00:00 2001 From: Denys Konovalov Date: Sat, 13 Jan 2024 18:36:33 +0100 Subject: [PATCH] add categories relation --- content/post/buchempfehlung-2023-1.md | 3 +-- static/admin/collections.js | 12 +++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/content/post/buchempfehlung-2023-1.md b/content/post/buchempfehlung-2023-1.md index 5c712c4..fa3325d 100644 --- a/content/post/buchempfehlung-2023-1.md +++ b/content/post/buchempfehlung-2023-1.md @@ -5,8 +5,7 @@ date: 2023-02-16 description: "" image: /media/buchempfehlung-2023-01.webp tags: - - buchempfehlung - - "2023" + - "" categories: - Buchrezension type: post diff --git a/static/admin/collections.js b/static/admin/collections.js index 6aee281..58205e1 100644 --- a/static/admin/collections.js +++ b/static/admin/collections.js @@ -58,10 +58,16 @@ const PostCollection = { }, { name: "categories", - label: "Kategorien", - widget: "list", - delimiter: ",", + label: "Kategorie(n)", + hint: "Kategorien müssen vorher im separeten Bereich erstellt werden.", + widget: "relation", + collection: "categories", + value_field: "{{title}}", + search_fields: ["title"], + display_fields: ["{{title}}"], + multiple: true, required: false, + options_length: 10000, }, { name: "type",