You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I'm trying to provide a UI that allows my client to select which items from a collection (work) will appear on the homepage and be able to control the order they display (preferably drag and drop).
My initial thought was to create list widget of relationship fields but this isn't the most user-friendly approach.
Is it possible to write a custom widget that pulls data (title, image, etc) from another collection? I can probably implement the drag/drop myself but would be great if there was some existing widget (ie. list) that I could wrap things in.
Here's a copy of my config.
backend:
name: git-gateway
branch: master # Branch to update (optional; defaults to master)
media_folder: "static/images/uploads"
public_folder: /images/uploads
collections:
- name: "work" # Used in routes, e.g., /admin/collections/blog
label: "Work" # Used in the UI
folder: "src/pages/work" # The path to the folder where the documents are stored
create: true # Allow users to create new documents in this collection
slug: "{{year}}-{{month}}-{{day}}-{{slug}}" # Filename template, e.g., YYYY-MM-DD-title.md
fields: # The fields for each document, usually in front matter
- {label: "Title", name: "title", widget: "string"}
- {label: "Subtitle", name: "subtitle", widget: "string"}
- {label: "Vimeo ID", name: "vimeoid", widget: "string"}
- {label: "Featured Image", name: "image", widget: "image"}
- {label: "Body", name: "body", widget: "markdown"}
- name: "pages"
label: "Pages"
files:
- file: "src/pages/home.md"
label: "Home"
name: "home"
fields:
- {name: "philosophyTitle", label: "Philosophy title", widget: string}
- {name: "philosophyContent", label: "Philosophy content", widget: markdown}
- {name: "approachTitle", label: "Approach title", widget: string}
- {name: "approachContent", label: "Approach content", widget: markdown}
- label: "Work"
name: "work"
widget: "list"
fields:
- {name: "workItem", label: "Work Item", widget: "relation", collection: "work", searchFields: ["title", "subtitle"], valueField: "title" }
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
So I'm trying to provide a UI that allows my client to select which items from a collection (work) will appear on the homepage and be able to control the order they display (preferably drag and drop).
My initial thought was to create
list
widget ofrelationship
fields but this isn't the most user-friendly approach.Is it possible to write a custom widget that pulls data (title, image, etc) from another collection? I can probably implement the drag/drop myself but would be great if there was some existing widget (ie.
list
) that I could wrap things in.Here's a copy of my config.
The text was updated successfully, but these errors were encountered: