Hi all,
I’m trying to set-up Netlify CMS with i18n (en + es) and nested collections.
As both seem to be beta features, I’m not sure if this would even work together. Hope someone can shed some light on this.
I’ve created a demo repo, with a basic configuration that I believe should work. The CMS however only shows the first content item.
If I understand it correctly;
The title is usually used for the slug, but with i18n I want different titles for each language.
The identifier field is therefore used for consistency between the two.
The meta path is used to specify the (sub-)folder.
See screenshots, config, and demo repo below.
Looking forward to any feedback…
Folder structure & CMS view
config.yml
backend:
name: github
repo: wslyvh/cms
branch: main
media_folder: static/assets/uploads/images
public_folder: /assets/uploads/images
i18n:
structure: multiple_folders
locales: [en, es]
default_locale: en
collections:
- name: 'pages'
label: 'Pages'
label_singular: 'Page'
folder: 'src/content/pages'
identifier_field: identifier
create: true
i18n: true
nested:
depth: 100
fields:
- { name: 'identifier', label: 'id', widget: 'string', i18n: 'duplicate' }
- { name: 'title', label: 'Title', widget: 'string', i18n: true }
- { name: 'body', label: 'Body', widget: 'markdown', i18n: true }
- { name: 'order', label: 'Order', widget: 'number', i18n: 'duplicate', required: false, value_type: 'int', min: 1, max: 1000, step: 1 }
meta: {
path: {
name: 'path',
label: 'Path',
widget: 'string',
i18n: false,
index_file: 'index',
hint: 'Path can be a sub-folder (e.g. main/sub)'
}
}
Github repo:
https://github.com/wslyvh/cms