my guess would be because role is not a valid attribute for a div.
If you add a class/id/title attribute, are they removed?
If you add role to a anchor tag <a href="#" role="button">Button Link</a>, does that get removed?
Than you. I used that and it worked for the role attribute but it stripped other attributes like class. I ended up adding those back in and now its working fine.
yes that would be correct, you just need to add @[role] to your existing validelements string (which would overwrite the standard umbraco validelements)
So it is probably better to remove ValidElements completely from your appsettings and just put @[role] in the extendedvalidelements
To allow all elements and attributes in the Rich Text Editor (RTE) in Umbraco 13.3, you can configure it through the appsettings.json file as you've mentioned. However, the configuration needs to be done correctly, and there might be additional steps to ensure that the TinyMCE settings are applied correctly.
Here are the steps you can follow to allow all elements and attributes in the RTE:
Edit appsettings.json: Ensure that you have the correct settings in your appsettings.json file.
Clear the Cache: Sometimes, Umbraco caches the settings. Clear the cache to make sure the new settings are applied. You can do this by restarting the application or manually clearing the cache.
Configure TinyMCE in the Backoffice: Ensure that the TinyMCE configuration in the backoffice is also set to allow all elements and attributes. You can do this by modifying the TinyMCE configuration in the Umbraco backoffice.
Go to Settings > Data Types.
Find your Rich Text Editor Data Type.
Edit the TinyMCE configuration and make sure to include the extendedvalidelements configuration.
Here's an example of how you can configure it:
Custom TinyMCE Configuration (Optional): If the above steps do not work, you can customize the TinyMCE configuration further by creating a custom TinyMCE configuration file and loading it in your Umbraco setup.
Check Permissions and Security Settings: Ensure there are no additional security settings or permissions that might be stripping out attributes. This can include server-side security configurations or additional sanitization logic in your code.
By following these steps, you should be able to configure the Rich Text Editor to allow all elements and attributes in Umbraco 13.3.
Your examples are incorrect "RichTextEditor": does not sit under "Content" it goes directly under "Umbraco" at the same level as "CMS"
setting ValidElements or extendedvalidelements to [] does not fix this, Umbrac always removes the role attribute from div and span tags.
Clear the Cache: Sometimes, Umbraco caches the settings. Clear the
cache to make sure the new settings are applied. You can do this by
restarting the application or manually clearing the cache.
Any change to appsettings requires a restart since they are only loaded on startup, manually clearing the cache won't make any difference.
how to allow all elements and attributes in RTE in umbraco 13.3?
I have tried editing appsetting.json:
"RichTextEditor": { "ValidElements": "*[*]" }
But it keeps stripping out attributes like
Also tried setting SanitizeTinyMce to false
my guess would be because role is not a valid attribute for a div.
If you add a class/id/title attribute, are they removed? If you add role to a anchor tag
<a href="#" role="button">Button Link</a>
, does that get removed?looks like it just removes it from div or span tags, might be worth checking TinyMCE docs
looks to be something Umbraco is doing.
using a native tinymce plugin outside of umbraco does not remove the role attribute
I have read both umbraco and tinymce documentation. All I could find was text saying to use "ValidElements" which does not work.
In previous versions of umbraco there was the ability to use "extendedvalidelements" but this does not seem to exist in umbraco 13.
Hi ninjajs,
I have done some playing around and worked out that you can add
@[role]
toextended_valid_elements
and it should then work.Than you. I used that and it worked for the role attribute but it stripped other attributes like class. I ended up adding those back in and now its working fine.
Here is the final solution:
}
yes that would be correct, you just need to add
@[role]
to your existing validelements string (which would overwrite the standard umbraco validelements)So it is probably better to remove ValidElements completely from your appsettings and just put
@[role]
in the extendedvalidelementsTo allow all elements and attributes in the Rich Text Editor (RTE) in Umbraco 13.3, you can configure it through the appsettings.json file as you've mentioned. However, the configuration needs to be done correctly, and there might be additional steps to ensure that the TinyMCE settings are applied correctly.
Here are the steps you can follow to allow all elements and attributes in the RTE:
Edit appsettings.json: Ensure that you have the correct settings in your appsettings.json file.
Clear the Cache: Sometimes, Umbraco caches the settings. Clear the cache to make sure the new settings are applied. You can do this by restarting the application or manually clearing the cache.
Configure TinyMCE in the Backoffice: Ensure that the TinyMCE configuration in the backoffice is also set to allow all elements and attributes. You can do this by modifying the TinyMCE configuration in the Umbraco backoffice.
Go to Settings > Data Types. Find your Rich Text Editor Data Type. Edit the TinyMCE configuration and make sure to include the extendedvalidelements configuration. Here's an example of how you can configure it:
Custom TinyMCE Configuration (Optional): If the above steps do not work, you can customize the TinyMCE configuration further by creating a custom TinyMCE configuration file and loading it in your Umbraco setup.
Check Permissions and Security Settings: Ensure there are no additional security settings or permissions that might be stripping out attributes. This can include server-side security configurations or additional sanitization logic in your code.
By following these steps, you should be able to configure the Rich Text Editor to allow all elements and attributes in Umbraco 13.3.
Hi girish,
Your examples are incorrect "RichTextEditor": does not sit under "Content" it goes directly under "Umbraco" at the same level as "CMS"
setting ValidElements or extendedvalidelements to [] does not fix this, Umbrac always removes the role attribute from div and span tags.
Any change to appsettings requires a restart since they are only loaded on startup, manually clearing the cache won't make any difference.
is working on a reply...