update posts and postCategories slug/relation
This commit is contained in:
parent
329997385f
commit
9a023e6a45
2 changed files with 3 additions and 3 deletions
|
|
@ -65,7 +65,7 @@ collections: # A list of collections the CMS should be able to edit
|
|||
editor:
|
||||
preview: false
|
||||
folder: content/posts
|
||||
slug: "{{slug}}"
|
||||
slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
|
||||
create: true # Allow users to create new documents in this collection
|
||||
fields: # The fields each document in this collection have
|
||||
- {label: Title, name: title, widget: string}
|
||||
|
|
@ -83,7 +83,7 @@ collections: # A list of collections the CMS should be able to edit
|
|||
widget: "relation"
|
||||
collection: "postCategories"
|
||||
searchFields: ["title"]
|
||||
valueField: "title"
|
||||
valueField: "name"
|
||||
- {label: Date / Order, name: date, widget: date}
|
||||
- {label: Post Featured Image, name: postFeaturedImage, widget: image, required: false}
|
||||
- {label: Excerpt, name: excerpt, widget: text}
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ class App extends Component {
|
|||
)
|
||||
const categoriesFromPosts = getCollectionTerms(posts, 'categories')
|
||||
const postCategories = this.getDocuments('postCategories').filter(
|
||||
category => categoriesFromPosts.indexOf(category.title.toLowerCase()) >= 0
|
||||
category => categoriesFromPosts.indexOf(category.name.toLowerCase()) >= 0
|
||||
)
|
||||
|
||||
return (
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue