CloudCannon / cloudcannon-config-migrator

Migrate your existing cms configuration into CloudCannon config
MIT License
6 stars 0 forks source link

Incorrect value_key for select options: change content_path to path #5

Closed ecupaio closed 1 year ago

ecupaio commented 1 year ago

I used the config-migrator to transfer my forestry settings to my new cloudcannon site. I had a select field that populated a list of pages from a collection and would enter the path as the

page front matter:

---
title: American Trilogy
featured: true
spirit: _spirits/chapmans-apple-brandy.md
ingredients:
- 1 oz Chapmans Apple Brandy
- 1 oz Purpose Rye
- 1 brown sugar cube
- 3 dashes orange bitters
image: "/img/american-trilogy-cocktail.jpg"
---

forestry settings for select field:

fields: 
- name: spirit
  type: select
  default: []
  config:
    required: false
    options: []
    source:
      type: pages
      section: spirits
      file: 
      path: 

cloudcannon configs for select field:

_inputs:
$.spirit:
  type: select
  comment: >-
    Select a spirit from the website. This list is populated by spirit
    pages added to the website. 
  options:
    values: collections.spirits
    value_key: content_path

According to the docs, valid values for the value_key object are: 'id', 'uuid', 'path', 'title', 'name'. content_path should be changes to path in order to make the field functional.

ecupaio commented 1 year ago

I just ran into this issue again and found my own issue! Change content_path to path.

tomrcc commented 1 year ago

Changed content_path to path Add cocktails scenario to tests using this repo. Built and tested select inputs on CloudCannon - they are now being populated by the collection using the value_key of path