Jump to:

5450 Posts in 1672 Topics by 1197 members

Customising the CMS

SilverStripe Forums » Customising the CMS » TinyMCE Templates not working under 2.4? (solved)

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

Page: 1
Go to End
Author Topic: 1280 Views
  • Ironcheese
    Avatar
    Community Member
    33 Posts

    TinyMCE Templates not working under 2.4? (solved) Link to this post

    Hi everyone,

    in my company we are using the TinyMCE template feature in Silverstripe 2.3 and it works great =)

    If I add it in 2.4 the way i added it in 2.3 the template wont show up in the popup. instead i see the errorpage of my website. oO?

    Is there another way to add this template feature to TinyMCE or any work around?

    thanks in advance

  • Ironcheese
    Avatar
    Community Member
    33 Posts

    Re: TinyMCE Templates not working under 2.4? (solved) Link to this post

    I found the problem:

    In SilverStripe 2.3 it works like this:

    'template_templates' => array(
    array('title'=>"my Template",'src'=>"themes/...

    In 2.4 you HAVE to use an Slash prefix!

    'template_templates' => array(
    array('title'=>"my Template",'src'=>"/themes/...

    cheers!

  • Ctr
    Avatar
    Community Member
    6 Posts

    Re: TinyMCE Templates not working under 2.4? (solved) Link to this post

    I'm trying to get this to work and was hoping you could share with me the file path you were using (was it in mysite/_config.php?) or did you use the MyLeftAndMainDecorator.php workaround famous here:
    http://open.silverstripe.org/ticket/4390?

    Also can you include the entire code snippet, I'm trying this without success:

    HtmlEditorConfig::get('cms')->setOption('template_templates','title[Title Here]|src[themes/mytheme/path/layout1.htm]|description[some description text]');
    This gives me an error message, which is more than what i get if i do:
    HtmlEditorConfig::get('cms')->setOptions(array('template_templates'=>array('title'=>'Title Here','src'=>'themes/mytheme/path/layout1.htm','description'=>'some description text');

    Any help would be very much appreciated!

  • Ctr
    Avatar
    Community Member
    6 Posts

    Re: TinyMCE Templates not working under 2.4? (solved) Link to this post

    I was lacking an array() level:

    HtmlEditorConfig::get('cms')->setOptions(array('template_templates'=>array(array('title'=>'Title Here','src'=>'themes/mytheme/path/layout1.htm','description'=>'some description text'))));

    And it is in the MyLeftAndMainDecorator.php file otherwise it is overwritten.

    Thanks for your code snippet Ironcheese it saved my day!

    1280 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.