Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
I need to add some custom attributes to the div tag on the Rich Editor source code. but there are no options to use Extended Valid Elements in the Umbraco core.
Is there any alternative solution for it?
FYI I'm using Umbraco 11
In the startup you can extend the configuration. The configruation is described here https://docs.umbraco.com/umbraco-cms/reference/configuration/richtexteditorsettings
You can add something like this, in the ConfigureServices methods
ConfigureServices
services.Configure<RichTextEditorConfiguration>(opts => { opts.ValidElements += "video,audio"; });
The .Net documentation for the configure method is found here
https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.optionsconfigurationservicecollectionextensions.configure?view=dotnet-plat-ext-7.0
Thanks for the quick reply.
As per instruction, I've added the below code but not working yet.
public void ConfigureServices(IServiceCollection services) { services.AddUmbraco(_env, _config) .AddBackOffice() .AddWebsite() .AddComposers() .Build(); services.Configure<RichTextEditorConfiguration>(opts => { opts.ValidElements += "div[*]"; }); }
It will automatically remove any custom attributes.
Eg : <div uk-grid="margin:uk-margin-large-top">{html}</div> Result : <div>{html}</div>
<div uk-grid="margin:uk-margin-large-top">{html}</div>
<div>{html}</div>
Is there any way to use the Extended Valid Elements Umbraco core?
Based on the document, it seems to be out of control
https://our.umbraco.com/documentation/Reference/Configuration-for-Umbraco-7-and-8/tinyMceConfig/#extended-valid-elements
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Tiny MCE Rich Editor - Extended Valid Elements
Hi,
I need to add some custom attributes to the div tag on the Rich Editor source code. but there are no options to use Extended Valid Elements in the Umbraco core.
Is there any alternative solution for it?
FYI I'm using Umbraco 11
Hi,
In the startup you can extend the configuration. The configruation is described here https://docs.umbraco.com/umbraco-cms/reference/configuration/richtexteditorsettings
You can add something like this, in the
ConfigureServices
methodsThe .Net documentation for the configure method is found here
https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.optionsconfigurationservicecollectionextensions.configure?view=dotnet-plat-ext-7.0
Thanks for the quick reply.
As per instruction, I've added the below code but not working yet.
It will automatically remove any custom attributes.
Eg :
<div uk-grid="margin:uk-margin-large-top">{html}</div>
Result :<div>{html}</div>
Is there any way to use the Extended Valid Elements Umbraco core?
Based on the document, it seems to be out of control
https://our.umbraco.com/documentation/Reference/Configuration-for-Umbraco-7-and-8/tinyMceConfig/#extended-valid-elements
is working on a reply...