Copied to clipboard

Flag this post as spam?

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


  • Joe Morrison 20 posts 80 karma points
    Sep 19, 2012 @ 12:30
    Joe Morrison
    0

    Alter TinyMCE to allow inline styles...

    Bear with me I know this sounds crazy... However we have built a templating system for clients to create their own emails in Umbraco it works brilliantly except...

    Our contracts with clients states that it will work across a variety of Email clients, however this unfortunately means some clients don't recognise css in the head of a document and thus for some links , images etc we require a style attribute to be added on the element inline.

    I have tried adding a custom attribute to tinyMCEConfig.config called "custom", which loads in the following (as per the documents on tinyMCE's website)

     

    tinyMCE.init({
        style_formats : [
            {title : 'Bold text', inline : 'b'},
            {title : 'Red text', inline : 'span', styles : {color : '#ff0000'}},
            {title : 'Red header', block : 'h1', styles : {color : '#ff0000'}},
            {title : 'Example 1', inline : 'span', classes : 'example1'},
            {title : 'Example 2', inline : 'span', classes : 'example2'},
            {title : 'Table styles'},
            {title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}
        ]
    });

    This is picked up, relevant code added to tinyMCE javascript compression handler, however doesn't appear to work with styles not being populated.

    Any help would be great as this functionality would allow us to create Umbraco as a complete email management system with an interface that the client already enjoys.

    Thanks,

    Joe

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Sep 19, 2012 @ 17:58
    Tom Fulton
    0

    Hi Joe,

    I'm not sure about this specifically, but I think there might be a certain format you need to add this code in.  I think tinyMCE.init is already being called, so you don't want to call it again.  Maybe try checking out this wiki article on Enabling the Template plugin for TinyMCE and look how they added the additional template_templates option and try to adopt that format.

    Hope this helps,
    Tom 

  • Joe Morrison 20 posts 80 karma points
    Sep 24, 2012 @ 15:07
    Joe Morrison
    0

    Hi Tom,

    Sorry for not getting back to you sooner, we are actually using the templating already which is pretty powerful - however there is nothing in TinyMCE for more advanced configuration (or so it seems) to include things like adding styles inline. Searching through the web and via TinyMCE themselves has proved fruitless, so it looks like it's rather impossible, which is a pity!

    Thanks for your help however,

    Joe.

Please Sign in or register to post replies

Write your reply to:

Draft