The implementation of this new content relationship field has been added to the latest beta version.
To use it, you can use the following configuration:
"frontMatter.taxonomy.contentTypes":[{"name":"project","pageBundle":false,"fields":[{"title":"Title","name":"title","type":"string","required":true},{"title":"Session","name":"session","type":"contentRelationship",// This is the new field type
"contentTypeName":"session",// Name of the content-type to link
"contentTypeValue":"slug",// The type of link/value you want to add. This can be slug, or path.
"required":true},{"title":"Session path","name":"sessionPath","type":"contentRelationship","contentTypeName":"session","contentTypeValue":"path","required":true}]}]
@adrian-ub, feel free to give it a try.
The implementation of this new content relationship field has been added to the latest beta version.
To use it, you can use the following configuration:
```json
"frontMatter.taxonomy.contentTypes": [
{
"name": "project",
"pageBundle": false,
"fields": [
{
"title": "Title",
"name": "title",
"type": "string",
"required": true
},
{
"title": "Session",
"name": "session",
"type": "contentRelationship", // This is the new field type
"contentTypeName": "session", // Name of the content-type to link
"contentTypeValue": "slug", // The type of link/value you want to add. This can be slug, or path.
"required": true
},
{
"title": "Session path",
"name": "sessionPath",
"type": "contentRelationship",
"contentTypeName": "session",
"contentTypeValue": "path",
"required": true
}
]
}
]
```
@adrian-ub, feel free to give it a try.
<!-- github-comment-id:1551808744 -->
@estruyf thanks for the early development, I have tested the implementation, it works correctly when the slug en property is set in the content
configuration in json file:
<img width="2032" alt="image" src="https://github.com/estruyf/vscode-front-matter/assets/22903142/a1ac03b9-64f6-4ec1-a371-61e09043de0f">
Content without field slug
<img width="2032" alt="image" src="https://github.com/estruyf/vscode-front-matter/assets/22903142/e0c09ae8-d2e3-431c-b9b6-9440af01442a">
<img width="2032" alt="image" src="https://github.com/estruyf/vscode-front-matter/assets/22903142/60a7ee45-ed88-4678-aecf-39c41799ad0f">
With field slug:
<img width="2032" alt="image" src="https://github.com/estruyf/vscode-front-matter/assets/22903142/b09cfe67-fd14-4ad0-bfa0-0e665c0a4a22">
<img width="2032" alt="image" src="https://github.com/estruyf/vscode-front-matter/assets/22903142/d49280d4-b81b-4d02-8a76-930c0acee058">
Example: https://github.com/adrian-ub/experiment-relationship-fronmatter
try to do it with pageBundle, but it gets me information from another contentType
<img width="2032" alt="image" src="https://github.com/estruyf/vscode-front-matter/assets/22903142/a28f0fbf-e9e3-445d-9db1-b08811bf6b51">
Example: https://github.com/adrian-ub/site-content
<!-- github-comment-id:1555419997 -->
I just did a minor fix to generate the slugs only in memory. That way, it will not get the undefined value.
To use it, first run the Front Matter: Clear cache command; once you run that, it will reinitialize the cache and the issue should be fixed.
I just did a minor fix to generate the slugs only in memory. That way, it will not get the `undefined` value.
To use it, first run the `Front Matter: Clear cache` command; once you run that, it will reinitialize the cache and the issue should be fixed.
<!-- github-comment-id:1559539493 -->
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/583
Originally posted by adrian-ub May 9, 2023
Relationship like Netlify CMS
https://decapcms.org/docs/widgets/relation/
The implementation of this new content relationship field has been added to the latest beta version.
To use it, you can use the following configuration:
@adrian-ub, feel free to give it a try.
@estruyf thanks for the early development, I have tested the implementation, it works correctly when the slug en property is set in the content
configuration in json file:
Content without field slug
With field slug:
Example: https://github.com/adrian-ub/experiment-relationship-fronmatter
try to do it with pageBundle, but it gets me information from another contentType
Example: https://github.com/adrian-ub/site-content
I just did a minor fix to generate the slugs only in memory. That way, it will not get the
undefinedvalue.To use it, first run the
Front Matter: Clear cachecommand; once you run that, it will reinitialize the cache and the issue should be fixed.