Skip to content

Folder collection path based on fields #7192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
snimavat opened this issue Apr 29, 2024 · 1 comment
Open

Folder collection path based on fields #7192

snimavat opened this issue Apr 29, 2024 · 1 comment
Labels
type: feature code contributing to the implementation of a feature and/or user facing functionality

Comments

@snimavat
Copy link

snimavat commented Apr 29, 2024

We can specify path template for a folder collection - as described in docs here :
Docs says, it supports template syntax similar to slug templates
Slug templates allows use of fields

We would like to organise content based on value of certain fields (including relation type fields)

Example : City collection, with a relation field for state
We would like to configure path for cities collection as path: '{{fields.state.name}}/{{slug}}'
So that the content would be saved as shown below

- state1
   --- city1.md
   --- city2.md
- state2
   --- city3.md
   --- city4.md

But looks like, folder collection path template doesnt allow use of fields

@snimavat snimavat added the type: bug code to address defects in shipped code label Apr 29, 2024
@martinjagodic martinjagodic added type: feature code contributing to the implementation of a feature and/or user facing functionality and removed type: bug code to address defects in shipped code labels Jun 13, 2024
@iWangJiaxiang
Copy link

I need this feature, too.

I tried to use the value from relation field in path but got error.

This feature is essential for me as my folder structure is more complex.

Now I have to stop managing posts using decap cms unless this feature is added.

Hoping this feature will be added asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

No branches or pull requests

3 participants