Originally posted by itsjavi April 3, 2023
I have 2 content types that have a very similar structure: "Page" and "Article", and I'd like to combine the fields that these 2 content types have in common, to avoid repeating the configuration. Kind of an "inheritance" / merge.
...
### Discussed in https://github.com/estruyf/vscode-front-matter/discussions/559
<div type='discussions-op-text'>
<sup>Originally posted by **itsjavi** April 3, 2023</sup>
I have 2 content types that have a very similar structure: "Page" and "Article", and I'd like to combine the fields that these 2 content types have in common, to avoid repeating the configuration. Kind of an "inheritance" / merge.
...
</div>
<!-- github-sync-id:1653331205 -->
Do you have any feedback on this @Fasani @itsjavi?
Edit: I think reusing the frontMatter.taxonomy.fieldGroups would be better. This setting allows you to set field groups for the new fieldCollection and block fields.
I am thinking about the following configuration/setup to reuse the fields:
```json
{
"frontMatter.taxonomy.fieldGroups": [
{
"id": "GeneralFields",
"fields": [
{
"title": "Title",
"name": "title",
"type": "string",
"single": true
},
{
"title": "Description",
"name": "description",
"type": "string"
}
]
}
],
"frontMatter.taxonomy.contentTypes": [
{
"name": "default",
"pageBundle": false,
"previewPath": "'blog'",
"filePrefix": null,
"fields": [
{
"name": "fieldCollection",
"type": "fieldCollection",
"fieldGroup": "GeneralFields"
},
{
"title": "Publishing date",
"name": "pubDate",
"type": "datetime",
"default": "{{now}}",
"isPublishDate": true
},
{
"title": "Content preview",
"name": "heroImage",
"type": "image",
"isPreviewImage": true
}
]
}
]
}
```
Do you have any feedback on this @Fasani @itsjavi?
*Edit*: I think reusing the `frontMatter.taxonomy.fieldGroups` would be better. This setting allows you to set field groups for the new `fieldCollection` and `block` fields.
<!-- github-comment-id:1721320835 -->
Great, I have added this logic to the latest beta version. Please feel free to test it out and let me know how it works for you.
Great, I have added this logic to the latest beta version. Please feel free to test it out and let me know how it works for you.
<!-- github-comment-id:1721518555 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Discussed in https://github.com/estruyf/vscode-front-matter/discussions/559
Originally posted by itsjavi April 3, 2023
I have 2 content types that have a very similar structure: "Page" and "Article", and I'd like to combine the fields that these 2 content types have in common, to avoid repeating the configuration. Kind of an "inheritance" / merge.
...
I am thinking about the following configuration/setup to reuse the fields:
Do you have any feedback on this @Fasani @itsjavi?
Edit: I think reusing the
frontMatter.taxonomy.fieldGroupswould be better. This setting allows you to set field groups for the newfieldCollectionandblockfields.@estruyf that will be enough :) thanks!
Great, I have added this logic to the latest beta version. Please feel free to test it out and let me know how it works for you.
@estruyf I finally could test it and works as expected, thanks for adding this! <3