TinyMCE - V13 Custom Config
d
In our V8 we have some custom conif in tinyMceConfig.config:
Copy code
<!-- this area is for custom config settings that should be added during TinyMCE initialization -->
    <customConfig>
        <!--    <config key="myKey">mySetting</config>-->
        <config key="entity_encoding">raw</config>
          <config key="style_formats">
            [
            {"title":"Headers","items":[{"title":"Header 2 (H2)","block":"h2"},{"title":"Header 3 (H3)","block":"h3"}]},
            {"title":"Languages","items":[{"title":"English","inline":"span", "attributes":{"lang":"en"}},{"title":"Japanese","inline":"span", "attributes":{"lang":"ja"}},{"title":"Chinese","inline":"span", "attributes":{"lang":"zh-Hans"}}]}
            ]
          </config>
    </customConfig>
I understand this is now done in appsettings.json Are there any tutorials or examples where I can achieve the same result?
I missed this documentation so will post back how I get on in case it's of use to anyone else: https://docs.umbraco.com/umbraco-cms/reference/configuration/richtexteditorsettings
j
I've gone through the same pain this week, finally figured most of it out so any questions give me a shout. Biggest one was if you link a stylesheet which contains any of these tags
/**umb_name:h1*/
this will then prevent the
style_formats
from the appsettings being used - it's one or the other sadly. What I did was create a new json file with all of the styles in and then in a component parse the file and minimise etc and push it into the appsettings
Umbraco:CMS:RichTextEditor:CustomConfig:style_formats
dynamically. Way more options this way and saves messing around with string escaping etc
d
Thanks Jamie - I like the idea of creating a new json file as you say to avoid all the escaping. @AaronSadlerUK and I both went the same route adding it to appsettings. I feel there has to be a better way for the new back office.
h
224 Views