- Do you want to request a feature or report a bug?
feature
- What is the current behavior?
Tagging can be manually implemented, but it requires work for the implementation
- What is the expected behavior?
Tagging should be a built-in feature. It should include out of the box (updated with suggestions from below):
All of that said, tagging should still be a plugin feature that can be swapped out, that makes use of existing widget functionality as much as possible.
Additionally, there's some details we should hash out:
config.yml? The first option is obviously a better UX but it'd complicate autocompletion a bit, as we'd have to collect and cache all previously used tags (scanning all posts on keypress sounds untenable).I'm sure there'll be more to discuss, but those are my initial thoughts.
My comments!
Firstly - yes please!!
Limiting tags to a list may be a good route for the initial implementation if it proves to be simpler, but ideally, specifying them in the config would be optional. @Benaiah we can optimize metadata collection as discussed in the past to simplify autocompletion.
Tags per collection, and waiting for a filtered view, totally agree.
@biilmann interested to hear your thoughts on this.
Here's what I'm thinking for requirements:
Configuration
Tag list editing
Widget UI
What is the lastet on this issue?
Sent with GitHawk
Actually this requires the relation widget to select values from a single entry rather than the current behavior of selecting the entire entry. There's an issue somewhere but I'm not seeing it atm. Also root level arrays in data files would also make sense with this.
Sent with GitHawk
Circling back - discussion in https://github.com/netlify/netlify-cms/pull/1100#issuecomment-370985705 is probably still our best plan - handle the concept of selecting one or more values, whether from a list in the config or from other entries, with a single widget. The path forward would look something like:
1) combine select and relation widgets
2) allow relations to specific values within an entry
This means the tags aren't in a single source-of-truth file necessarily, but they can be.
collections:
- name: posts
folder: content/posts
fields:
- name: tags
widget: select
multiple: true
create: true
selectFrom:
- collection: posts
field: tags
The above example would result in a select field that can select from a list of unique values used across entries in the posts collection in the tags field (via path). The CMS would create the unique list and cache it, only updating it as necessary, so the relation wouldn't require searching across entries, just within the cached list, meaning selectFrom would essentially drive a form of indexing. The indexing concept may be a bit limited when it comes to large repos selecting from lengthy fields. Maybe internally impose a max size limit and perf just sucks a little b/c there's no index.
I'd expect the above behavior to be pretty standard (selecting from the same field in other entries of the current collection), so selectFrom: true will probably be shorthand for this configuration.
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.
Did this ever get done?
Sort of - multi select is now supported for the select widget, so you can use that for a static list of tags defined in the config. More robust support is still forthcoming, so this should remain open.
Sent with GitHawk
Remaining work for this issue will be covered under #1489.
Most helpful comment
Circling back - discussion in https://github.com/netlify/netlify-cms/pull/1100#issuecomment-370985705 is probably still our best plan - handle the concept of selecting one or more values, whether from a list in the config or from other entries, with a single widget. The path forward would look something like:
1) combine select and relation widgets
2) allow relations to specific values within an entry
This means the tags aren't in a single source-of-truth file necessarily, but they can be.
The above example would result in a select field that can select from a list of unique values used across entries in the
postscollection in thetagsfield (viapath). The CMS would create the unique list and cache it, only updating it as necessary, so the relation wouldn't require searching across entries, just within the cached list, meaningselectFromwould essentially drive a form of indexing. The indexing concept may be a bit limited when it comes to large repos selecting from lengthy fields. Maybe internally impose a max size limit and perf just sucks a little b/c there's no index.I'd expect the above behavior to be pretty standard (selecting from the same field in other entries of the current collection), so
selectFrom: truewill probably be shorthand for this configuration.