Feature idea: singleton collections (collections with exactly one entry)
#1631
dennisklappe
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi. Really enjoying emdash. I'd like to propose a small
singletonsupport flag for collections.Problem. Some collections are inherently one of a kind: a homepage, an "about" page, a global settings record. Modeling them as a normal collection means the sidebar links to a list view that always holds exactly one entry, so editing takes two clicks (the collection, then the single entry) and the UI shows "Add new" and delete affordances that don't apply.
Proposal. A
"singleton"value in a collection'ssupportsarray:"locked"(the one entry can be edited but not created or deleted), reusing the existing locked enforcement on the create and delete handlers.Status. I've implemented it in my fork, dennisklappe/emdash-klappe. It's a small, additive change to the support flags plus the admin sidebar and content-list route, with the create/delete guard reusing the existing
lockedpath. Happy to open a PR if you'd want this upstream. Just let me know about the CLA and your preferred shape.(The fork also adds nested sidebar subfolders via slash-delimited
grouppaths, for example"Pages/Legal", if that is interesting separately.)All reactions