Comments (6)
@lotas @Swissbite this seems to work just fine. Thank you for implementing this!
from contentful-graph.
@lotas I just saw the issue and I added an example contentful export with richtext.
The schema includes two models:
Simple Image Caption
A simple content model to have a reference / filter for the other schema. It has 3 fields, a name, a caption and an asset reference for images.
Graph Example with Richttext Item
It has 4 fields
Title - A basic title, to be able to find it in the overview
Richtext all options enabled - All options enabled, no validation set. Therefore, all content models can be referenced in this richtext
{
"id": "richtextAllOptionsEnabled",
"name": "Richtext all options enabled",
"type": "RichText",
"localized": true,
"required": true,
"validations": [
{
"nodes": {
}
}
],
"disabled": false,
"omitted": false
}
Richtext only media assets - This has a basic filter to only enable formats, hyperlinks and links / inline reference to assets.
{
"id": "richtextOnlyMediaAssets",
"name": "Richtext only media assets",
"type": "RichText",
"localized": true,
"required": false,
"validations": [
{
"enabledNodeTypes": [
"heading-1",
"heading-2",
"heading-3",
"heading-4",
"heading-5",
"heading-6",
"ordered-list",
"unordered-list",
"hr",
"blockquote",
"embedded-asset-block",
"asset-hyperlink",
"hyperlink"
],
"message": "Only heading 1, heading 2, heading 3, heading 4, heading 5, heading 6, ordered list, unordered list, horizontal rule, quote, asset, link to asset, and link to Url nodes are allowed"
},
{
"nodes": {
}
}
],
"disabled": false,
"omitted": false
}
Richtext with defined reference to caption - This Richtext definition disabled link and embeding assets and allowing all other node types.
For references / links to content model, the nodeTypes "embedded-entry-block", "entry-hyperlink", "embedded-entry-inline"
are possible items. They can be validated against specific content model definition or may have no validation. No validation means that all content models can be referenced.
{
"id": "richtextWithDefinedReferenceToCaption",
"name": "Richtext with defined reference to caption",
"type": "RichText",
"localized": true,
"required": false,
"validations": [
{
"enabledNodeTypes": [
"heading-1",
"heading-2",
"heading-3",
"heading-4",
"heading-5",
"heading-6",
"ordered-list",
"unordered-list",
"hr",
"blockquote",
"embedded-entry-block",
"entry-hyperlink",
"embedded-entry-inline"
],
"message": "Only heading 1, heading 2, heading 3, heading 4, heading 5, heading 6, ordered list, unordered list, horizontal rule, quote, block entry, link to entry, and inline entry nodes are allowed"
},
{
"nodes": {
"embedded-entry-block": [
{
"linkContentType": [
"simpleImageCaption"
],
"message": null
}
],
"embedded-entry-inline": [
{
"linkContentType": [
"simpleImageCaption"
],
"message": null
}
],
"entry-hyperlink": [
{
"linkContentType": [
"graphExampleWithRichttextItem"
],
"message": null
}
]
}
}
The attached file contains the complete schema export with the models described above. contentful-export-richtext-example-2020-10-24T18-24-20.json.txt
PS: Github does not allow to upload a file with the ending json
, so I added the .txt
suffix :-)
from contentful-graph.
Hi @jugglingthebits! Thanks for the feedback :)
Yes, this is pretty much active, but I don't work with contentful anymore, so not actively developed, so to say ;)
Features and PRs are highly appreciated, thank you.
from contentful-graph.
Can you post an exported json schema? To have a look, why it is not picked up?
from contentful-graph.
@Swissbite I've merged your PR, thank you for the contribution 👍
@jugglingthebits can you please pull latest version and check if the issue was fixed for you?
from contentful-graph.
@lotas will do!
from contentful-graph.
Related Issues (15)
- General issues HOT 2
- Make it an npm module HOT 5
- Hyphens and spaces in element names lead to syntax error with dot HOT 3
- throws TypeError if multiple reference field contains validation for non-existent content type HOT 3
- Use content type id's as dot node id's and escape labels HOT 3
- No 'latest' release HOT 4
- space.getEnvironment is not a function error HOT 7
- Output to diagrams.net HOT 3
- RichText link does not reflect all configurations #19 HOT 2
- Update dependencies to "latest" version HOT 3
- Getting data over distribution api does not work anymore HOT 1
- Doesn't map out all relations HOT 4
- What do the different colors mean? HOT 1
- I'm getting status 403 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from contentful-graph.