英文:
How to add styles directly in Rich Text Editor in Umbraco 10
问题
我尝试在Umbraco 10的富文本编辑器内容中直接编写样式,但这并不起作用,写入样式并保存后,整个RTE变成白色,打开源代码后,所有内容和样式都消失了。我已经搜索了论坛,但没有找到可以解决我的问题的解决方案。有人可以帮助我吗?
请帮助我如何在Umbraco 10的RTE内容中直接添加样式。
英文:
I'm trying to write styles directly in the content of Rich text Editor in Umbraco 10, but that was not working and after writing style and saving it, the whole RTE getting white and when opening the source code all content and styles are disappearing. I've searched the forums and haven't found a solution that could fix the issue for me.
Can anyone help me?
Please help me how to add styles directly in content of RTE in umbraco 10
答案1
得分: 1
Not entirely sure I'm following what you are trying to do, but if you configure "validElements" to include "style" (like in the example in the link) you should be allowed to have a <style>
tag in your RTE code.
If you are trying to inline styles via a style attribute on some other element, you can configure that too.
Say you want to add style="something: something" to a div, should be able to add +div[style] to the validElements config.
And of course, if there is no RichTextEditor section in your appsettings.json, you'll need to add it yourself, just like in the example on Umbraco Docs.
英文:
Have you (googled and) taken a look at https://docs.umbraco.com/umbraco-cms/v/10.latest-lts/reference/configuration/richtexteditorsettings already?
Not entirely sure I'm following what you are trying to do, but if you configure "validElements" to include "style" (like in the example in the link) you should be allowed to have a <style>
tag in your RTE code.
If you are trying to inline styles via a style attribute on some other element, you can configure that too.
Say you want to add style="something: something" to a div, should be able to add +div[style]
to the validElements config.
And of course, if there is no RichTextEditor section in your appsettings.json, you'll need to add it yourself, just like in the example on Umbraco Docs.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论