umbraco / Umbraco-CMS

Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
https://umbraco.com
MIT License
4.41k stars 2.66k forks source link

RTE Property in custom backoffice view #15474

Closed AndersBrohus closed 8 months ago

AndersBrohus commented 9 months ago

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

13.0.1

Bug summary

Hi, We are upgrading an Umbraco 10 website to Umbraco 13 - We are facing some issues with the updated RTE, and only the RTE field.

The config for the RTE is the following,

thankYouText = {
    alias: 'thankYouText',
    editor: 'Umbraco.TinyMCE',
    label: 'Thank you text',
    hideLabel: false,
    description: '',
    view: 'rte',
    value: vm.model.data.thankYouText,
}

But we are getting an error in the console, Could not find umbVariantContent in the $scope chain

How should we "inject" this into our custom backoffice view?

Specifics

No response

Steps to reproduce

Try to upgrade a website with a custom backoffice view which contains an RTE

Expected result / actual result

A working RTE

github-actions[bot] commented 9 months ago

Hi there @AndersBrohus!

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 :robot: :slightly_smiling_face:

nielslyngsoe commented 8 months ago

Hi @AndersBrohus

Thanks for reporting this issue, I see the problem and I understand why you still want to be able to do this.

The problem originates in the implementation of Blocks, as the editing of Blocks works as a sub editor, giving us more requirements for the implementation of the Rich Text Editor.

That though does not make your use case less valuable, so sorry for the inconvenience.

I think your description is good, but it does not clarify enough for me to verify if this idea could be a solution to the problem, so please help me verify your needs:

I will suggest that we lower the implementation requirements, to what was required before. With the down side of Blocks not being supported when only the minimal implementation is provided. In other words, you will be able to use the Rich Text Editor in your custom view again. But not insert Blocks into that Rich Text Editor.

The background for such begin that I think it would be a tough job for you to implement the new requirements correctly.

How does that sound?

Also, on a side note, and of personal interest. Could you describe a bit more of the use case of your custom view. What it is and what its used for.

Thanks in return

AndersBrohus commented 8 months ago

Hi @nielslyngsoe

That sounds like a great idea :) We are interested in a simple TinyMCE for the editor to create an HTML string :)

On this specific case, we have a custom section where you can edit data from a custom database, but in a Umbraco like experience, this data has nothing to do with Umbraco, but is a part of the website :)

abjerner commented 8 months ago

Just for reference, this also affects my Tables package, so for now I'm unable to update the package to target Umbraco 13.

Unless I've missed Umbraco declaring this a breaking change for Umbraco 13, I'm seeing this a regression issue because umbVariantContent is now required in order to use the build-in RTE property editor in custom views.

Updating the build-in RTE property editor to not require umbVariantContent, but then not support nested blocks if umbVariantContent isn't available, will be an acceptable solution in my case 👍

leekelleher commented 8 months ago

FYI (for the context in this discussion), I hit the same issue with Contentment (using the RTE in the data-type configuration, for the Notes editor). But because I didn't catch it early enough, Umbraco 13 had already been released so I ended up rolling my own custom RTE; ref: https://github.com/leekelleher/umbraco-contentment/pull/371/commits/c4926c257195a3e4a4f4d7d85baf496bde6f967a#diff-fd57691c707aae91e655d7b48b4c937f4341a51c3e8bb619bc283172b4500893

Zeegaan commented 8 months ago

Fixed in https://github.com/umbraco/Umbraco-CMS/pull/15556 🚀

marcemarc commented 7 months ago

Thanking all! - this just saved the day! - in terms of use case, on this site being migrated to v13, the editing experience is extended beyond that of updating content on the website, to contain custom dashboards to manage content change requests made on the front end by members of the association, so the implementation uses an RTE to show the HTML changes requested and enable the site administrator to tweak the HTML and then Approve / Reject changes

image

This was all built in the V7 days before Plumber and Umbraco UI Builder.

It doesn't need to be the same implementation as the backoffice RTE, (particularly as this evolves) but it really helps extend Umbraco if there are a bunch of common components you can just use without faff to build up your dashboards and sections.