Display existing tags in CMS widget

Hi, I’m quite new to Netlify CMS, but have a general handle on creating custom post types and managing CMS widgets and fields. Simple question: if I have tags established with a list widget, can it display existing tags for authors to choose from? As it does in Wordpress. My editor currently shows a regular text input. Code for the collection item is:

- name: "submissions"
label: "Submissions"
folder: "src/submissions"
slug: "{{slug}}"
preview_path: "submissions/{{slug}}"
create: true
fields:
  - {label: "Text", name: "text", widget: "string"}    
  - {label: "Publish Date", name: "date", widget: "datetime"}
  - {label: "Tags", name: "tags", widget: "list", allow_add: true}

Hi there, @BenFictional :wave:

Thanks for your interest in Netlify CMS. Looks like you posted your question a little while ago, but that you haven’t received a solution yet. Here’s where you might get more help:

netlifycms.org - the site houses our extensive documentation that likely contains helpful information to get you back on track.

netlify cms slack - join our friendly slack channel and chat with other cms pros to get the help you need.

GitHub Issues - think you’ve found a bug, or would like to make a feature request? Make your voice heard here. Netlify CMS is open source - PRs and other contributions are also welcome!

Stack Overflow Check StackOverflow for questions tagged “Netlify CMS” if you don’t get an answer in the Slack or the GH issues. StackOverflow reaches a worldwide audience of knowledgeable people.

Your question will be left open here for anyone to comment - but we encourage you to check out the above resources if you are still looking for a solution! Additionally, @tomrutgers may have some CMS insights here.

Thanks :slight_smile:

@BenFictional The relation widget is what you’re looking for! You set up a collection for your tags and then reference that collection with the relation widget. This should point you in the right direction:

- name: tags
  label: Categories
  folder: "src/tags"
  create: true
  slug: "{{name}}"
  identifier_field: name
  summary: "{{name}}"
  fields: 
    - {name: name, label: Name}


- name: "submissions"
  label: "Submissions"
  folder: "src/submissions"
  slug: "{{slug}}"
  preview_path: "submissions/{{slug}}"
  create: true
  fields:
    - {label: "Text", name: "text", widget: "string"}    
    - {label: "Publish Date", name: "date", widget: "datetime"}
    - name: tags
      label: Tags
      widget: relation
      collection: "tags"
      search_fields: ["name"]
      value_field: "name"
      display_fields: ["name"]
      multiple: true
1 Like