Block content editor #15559
Replies: 4 comments
-
@AndreasJacobsen A follow up question to your feature requests here: Would Markdown be a usable alternative to having it as the json output you included above? ... You have quite a lot of details in the json output, so I can understand if Markdown is not sufficient, but curious if it could be a useful alternative. |
Beta Was this translation helpful? Give feedback.
-
Markdown is not an equivalent alternative. Personally I love markdown and use it allot. I think it would allow for most of the functionality I want. But I cannot assume that my editors know markdown or remember all our custom tags. It would also be marginally more difficult to work with, but better than pure HTML. This is a huge undertaking to fix, but for a headless CMS this is the "best" way to handle things in my mind. (best would be an option to choose HTML or JSON output for those not used to JSON). We also have a blind employee who struggles with markdown, things like ## for a heading is not announced by default by some screen readers. If they are announced hearing "Hashtag, hashtag, hashtag" for heading level 3 may not provide the best experience. For an open source example I think editor.js visually works well, for screen reader users editor.js (at least default implementation) is not very nice. It´s mostly the JSON structure I like, it can create whatever I want. This would make things missing from Umbraco "easy" without the need for C#. One example of that could be figures with links in their text; currently figures can only contain pure text in Umbraco Heartcore (most of our figures are screenshots from websites with a link to the site). If you give me a bunch of basic data types I can use (string, number etc) I can put them together to make basically anything. Feel free to contact me for a tour of how this is done in our old CMS. I just don´t feel like it´s good practice to "advertise" for a competing CMS here. export default {
title: "Image",
name: "figure",
type: "image",
options: {
hotspot: true,
},
fields: [
{
name: "alt",
type: "string",
title: "Alternative text",
options: {
isHighlighted: true,
},
},
{
name: "height",
title: "Height",
description: "Image height in px",
type: "number",
},
{
name: "width",
title: "Width",
description: "Image width in px",
type: "number",
},
{
name: "isFigure",
title: "Figure",
type: "boolean",
description: "Is this image a figure? Enables figcaption",
initialValue: false,
options: {
isHighlighted: true,
},
},
{
name: "figcaption",
title: "Figcaption",
description: "Text shown under the image",
type: "smallBlockContent",
hidden: ({ parent }) => !parent?.isFigure,
options: {
isHighlighted: true,
},
},
],
}; This outputs the following to our front end { "_key": "b8596f46ece2",
"_type": "figure",
"alt": "Umbraco logo",
"asset": {
"_ref": "image-a3da59c681f7e75e2656f3ba3af0f759b307eefe-723x723-png",
"_type": "reference"
},
"figcaption": [
{
"_key": "97343490942a",
"_type": "block",
"children": [
{
"_key": "cf2ae21eac3f",
"_type": "span",
"marks": [],
"text": "Umbraco logo found at "
},
{
"_key": "1e61c2cadd30",
"_type": "span",
"marks": [
"397697f9123d"
],
"text": "Umbraco - flexible open-source .NET (ASP.NET Core) CMS"
},
{
"_key": "2935f940313b",
"_type": "span",
"marks": [],
"text": " "
}
],
"markDefs": [
{
"_key": "397697f9123d",
"_type": "link",
"href": "https://umbraco.com/"
}
],
"style": "normal"
},
{
"_key": "f5edb1bc9d4a",
"_type": "block",
"children": [
{
"_key": "275af0af5ba1",
"_type": "span",
"marks": [],
"text": "I can also have headings in my figure text"
}
],
"markDefs": [],
"style": "h3"
}
],
"isFigure": true
} |
Beta Was this translation helpful? Give feedback.
-
Hi @AndreasJacobsen, With Umbraco CMS having released a headless delivery API as of v12 earlier this year, we think that this feature no longer makes sense for Heartcore to add in isolation. Rather, it should probably be part of the core CMS that Heartcore can additionally benefit from. I am therefore going to transfer this issue to the core CMS issue tracker. |
Beta Was this translation helpful? Give feedback.
-
Hi there @AndreasJacobsen! Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better. We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.
We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
Beta Was this translation helpful? Give feedback.
-
Issue description
This is a future future request, not a bug :)
What I want
We are migrating from a CMS with a "block content" rich text editor. Data from rich text editor and everything else is stored and sent as JSON.
An example to make things more clear, I added some data to our old CMS, visually it looks like this
![screenshot of text editor in sanity CMS showing heading, paragraph and list](https://user-images.githubusercontent.com/8527173/208640390-f351db6e-1837-4fdd-8bb3-f5e18ffb567c.png)
The API serves this data to us as JSON. Initially I was slightly annoyed at not being able to get things in pure HTML. Now I find it painful to go back to HTML, it feels and is limiting for us.
The ability to serve content in a similar way via Umbraco Heartcore would make the CMS easier for us to recommend to others, and it greatly increase the freedom we have to do things as we want.
Why I want this
Having lived with JSON-data from CMS for a number of years we have grown accustomed to be able to do whatever we want with data from the CMS.
One of our primary use cases is to generate WCAG audits, these result inn 100+ page web reports. For our customer portal we want data to be shown one way. For this the current Umbraco Heartcore way of serving HTML works well enough, although we are forced to do things in a way we find less optimal.
But we do more with the same data.
An audit is used to generate PDF-document (different HTML and CSS needed), Excel-documents (good luck working with HTML in Excel), Word-documents (again HTML is not ideal) and for some clients an API with raw data in JSON so they can integrate things into their own systems. This API we host ourselves and periodically pull data from CMS.
Do other people want this?
I am a weird person that likes weird things, but I feel very strongly that many developers prefer JSON whenever possible. Writing a serializer is not that hard once you figure out what "serializer" actually means. My friend circle can best be described as hipster young developers with smart mugs and too many reddit karma points, most of them reacted with slight disgust when I told them my new CMS serves rich text in HTML. I had to explain that the Umbraco UX is really good to defend myself. Other developers may be more normal people that don't have such strong feelings about HTML from a CMS.
Freedom 🇺🇸
JSON is freedom. Freedom to do whatever I want with the data wherever I want, be that an app, a site or a PDF.
But JSON freedom is not truly free unless you can also create your own JSON-structures. My dream is an editor where I can add any arbitrary JSON structure (that Umbraco accepts) and send this to my frond end/whatever. This is how we did things with our old CMS making adding complex content to rich text editor as easy as creating a few lines of JSON and a React-component that consumes this JSON.
Beta Was this translation helpful? Give feedback.
All reactions