Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Martin van der Wolf 2 posts 22 karma points
    Nov 26, 2012 @ 14:41
    Martin van der Wolf
    0

    Adding initialization options to TinyMCE

    I'm trying to override the standard formatting options for tinyMCE using style_formats, I've looked up how to on the tinyMCE forums but there seems to be no information on how to add such overrides in Umbraco. The usual method is to add it in the tinymce.init() method.

    People refer to the tinymceconfig.config file, but I have no clue as to where I have to put my code there. My first guess was in CDATA, for obvious reasons, but it doesn't seem to affect my styles at all.

    <invalidElements>font</invalidElements>

    <!-- this area is for custom config settings that should be added during TinyMCE initialization -->
    <![CDATA[',
    style_formats : [
    {title : 'Arial', inline : 'span', attributes : { 'class' : 'arial'}},
    {title : 'Helvetica', inline : 'span', attributes : { 'class' : 'helvetica'}},
    {title : 'Tahoma', inline : 'span', attributes : { 'class' : 'tahoma'}},
    {title : 'Times New Roman', inline : 'span', attributes : { 'class' : 'times'}},
    {title : 'Trebuchet', inline : 'span', attributes : { 'class' : 'trebuchet'}}],
    ]]>
    <customConfig>

    Of course, it could be that my syntax is screwed up in this context, but I don't get any feedback from tinyMCE regarding that.

  • Mike Chambers 635 posts 1252 karma points c-trib
    Nov 26, 2012 @ 16:42
    Mike Chambers
    0

    like this

        
        
        <customConfig>
        <!--    <config key="myKey">mySetting</config>-->
        <config key="entity_encoding">raw</config>
        <config key="spellchecker_rpc_url">GoogleSpellChecker.ashx</config>
    <!-- START ADDED -->
        <config key="theme_umbraco_path">true</config>
        <config key="theme_umbraco_statusbar">true</config>
        <config key="theme_umbraco_statusbar_location">bottom</config>
        <config key="template_external_list_url">/scripts/vendor/tinyMCETemplates/templates.js</config>
        <config key="template_popup_height">400</config>
        <config key="theme_umbraco_blockformats">p,h2,h3,h4,address,pre</config>
        <config key="theme_umbraco_styles">;list-alphabetical=.list-alphabetical;list-roman=.list-roman;</config>
    
       <!-- END ADDED -->
      </customConfig>
    
        
    
      
  • Mike Chambers 635 posts 1252 karma points c-trib
    Nov 26, 2012 @ 16:43
    Mike Chambers
    0

    ps left a few other amends we make to bring useful tinymce elements back into the fold

  • Martin van der Wolf 2 posts 22 karma points
    Nov 26, 2012 @ 17:04
    Martin van der Wolf
    0

    Ah, thanks. Yeah, this seems to work. Most examples I found just used Javascript.

Please Sign in or register to post replies

Write your reply to:

Draft