Jump to:

5542 Posts in 1739 Topics by 1225 members

Customising the CMS

SilverStripe Forums » Customising the CMS » TinyMCE customizing

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 452 Views
  • Glennrf
    Avatar
    Community Member
    1 Post

    TinyMCE customizing Link to this post

    I'm new here so I am not sure if this is the place for this question.

    All I am trying to do is add a couple of new options to the "Format" drop down list for example I would like to add <Div> and <Span> options to the list. Ideally, I would like to add things like Red Box which would create a Div tag with a class= redbox, which I have defined in my typography.css file and in my editor.css file.

    I can get redbox to show up in my "styles" drop down, but it defaults to a <P> tag.

    I also have a box style that I use to create a 3 column box layout ie.

    box1{
    float:left;
    width:225px;
    }
    box2{
    float:left;
    width:225px;
    }
    box3{
    float:right;
    width:225px;
    }
    After box3, I need to add a <div style="clear:both"></div>

    Is there anyway to do this in the editor?

    Thanks in Advance
    Glenn

  • Steeloctopus
    Avatar
    Community Member
    4 Posts

    Re: TinyMCE customizing Link to this post

    For SS 3.1 you can manipulate the Format drop down by changing the following line in the _config.php

    HtmlEditorConfig::get('cms')->setOption('theme_advanced_blockformats', 'p,div,address,pre,h1,h2,h3,h4,h5,h6,div,span');

    452 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.