Jump to:

5513 Posts in 1732 Topics by 1218 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Font Color in CMS

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

Page: 1
Go to End
Author Topic: 1126 Views
  • goodness
    Avatar
    Community Member
    38 Posts

    Font Color in CMS Link to this post

    I am running SilverStripe 3.0.5 and don't see any way to select a different font color within the CMS.
    Even if I bring up the HTML Source Editor and hand code the font color, it doesn't take.

    This seems like it should just be a default option in the CMS editor.

    I attached an image showing what is presented for editing in the CMS.

    Thanks!

    Attached Files
  • Optic Blaze
    Avatar
    Community Member
    161 Posts

    Re: Font Color in CMS Link to this post

    Hello...me again.

    Silverstripe works on the basis that the developer styles the design of fonts etc in the .css files. You would therefore set the colours for your <p> and H1->H6 tags etc in the typography.css file. We don't really encourage changing font colours on the fly, because you might have a lovely design and then a content editor messes it up by using some awful coloured text. You will also notice that unlike other CMS's you cant change the font faces in the CMS either...for the same reason.

    That being said, if it is critical to the design of your site that users be able to do that...you can extend the TINMCE interface to allow making changes to fonts and colours...this hower will require some coding.

    Go to your _config.php file and add the following code:

    // Enable text colour in the CMS
    HtmlEditorConfig::get('cms')->insertButtonsAfter('strikethrough', 'forecolor');

    here is a article on it:
    http://www.ssbits.com/tutorials/2009/customising-the-wysywig-editor-in-v2-3-2-tinymce/

  • goodness
    Avatar
    Community Member
    38 Posts

    Re: Font Color in CMS Link to this post

    Thanks!

    I inserted this line of code like you said:

    // Enable text colour in the CMS
    HtmlEditorConfig::get('cms')->insertButtonsAfter('strikethrough', 'forecolor');

    and the options showed up in the editor.

    If I ever want to remove them I'm assuming I would just remove the code and then run dev/build.

  • Optic Blaze
    Avatar
    Community Member
    161 Posts

    Re: Font Color in CMS Link to this post

    Yes that is correct. But there is alot more that you can do with the TinyMCE Editor and lots of ways you can extend the functions that it has in the CMS

    Have a look at this: http://www.tinymce.com/tryit/full.php

    This will give you an idea of all the other plugins/buttons that you can add to the Silverstripe CMS if you want to

  • secuaz
    Avatar
    Community Member
    21 Posts

    Re: Font Color in CMS Link to this post

    Hi all I have the same problem but need to add a dropdown to select the font family. I have not been successful finding that dropdown.
    HtmlEditorConfig::get('cms')->insertButtonsAfter('formatselect', '????');

    What would i have to add to this???

    Thank youu!!!

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