Questions and Answers

How do I collect points?

  • +4
    Chosen as best answer
  • +1
    Posted answer
  • +1
    Posted question
  • +1
    Thumb up
  • -1
    Thumb down
5

by Paul Spoerry in Coding about October 4, 2012 closed - report

Enhanced TinyMCE with SocialEngine

The TinyMCE that comes out of the box works well enough but boy is it missing some features. Hello? Can I change my font or what? Once I found out it was TinyMCE I knew it just had a bunch of options disabled by default. 

 

The full list of options available is here: http://www.tinymce.com/wiki.php/Buttons/controls if you guys can think of anything else you need you can insert them as well. 

 

File Location:

/public_html/application/libraries/Engine/View/Helper/TinyMCE.php

 

You'll be modifying: class Engine_View_Helper_TinyMce

In version 4.2.6 the following code will begin on line 55. This is where the settings for TinyMCE are defined. 

 

The important parts to note are in theme_advanced_buttons1 and theme_advanced_buttons2. Some features were added to theme_advanced_buttons1 which is the top row in TinyMCE. In the existing file theme_advanced_buttons2 is empty, we simply create a new array of items to put into that row and they will display as the second row in TinyMCE. When you're done the modification will look like what's displayed in the attached image.

 

Modify this:

protected $_config = array(
'mode' => 'textareas',
'plugins' => array(
'emotions', 'table', 'fullscreen', 'media', 'preview', 'paste',
),
'theme' => 'advanced',
'theme_advanced_buttons1' => array(
'undo', 'redo', 'cleanup', 'removeformat', 'pasteword', '|', 'code',
'media', 'image', 'fullscreen', 'preview'
),
'theme_advanced_buttons2' => '',
'theme_advanced_buttons3' => '',
'theme_advanced_toolbar_align' => 'left',
'theme_advanced_toolbar_location' => 'top',
'element_format' => 'html',
'height' => '225px',
'convert_urls' => false,
'media_strict' => false,
);

 

And make it this:

protected $_config = array(
'mode' => 'textareas',
'plugins' => array(
'emotions', 'table', 'fullscreen', 'media', 'preview', 'paste',
),
'theme' => 'advanced',
'theme_advanced_buttons1' => array(
'emotions', 'undo', 'redo', 'cleanup', 'removeformat', 'pasteword', '|', 'code',
'media', 'image', 'fullscreen', 'preview', 'hr', 'visualaid', 'sub', 'sup', 'separator', 'charmap',
),
'theme_advanced_buttons2' => array( 
'fontselect', 'fontsizeselect', 'bold', 'italic', 'underline', 'strikethrough', 'forecolor', 'backcolor', '|', 'justifyleft', 
'justifycenter', 'justifyright', 'justifyfull', '|', 'bullist', 'numlist', '|', 'outdent', 'indent', 'blockquote',
),
'theme_advanced_buttons3' => '',
'theme_advanced_toolbar_align' => 'left',
'theme_advanced_toolbar_location' => 'top',
'element_format' => 'html',
'height' => '225px',
'convert_urls' => false,
'media_strict' => false,
);

Answers: 2  •  Score 2  •  Views: 2932

2 Answers
Browse by
  • 400

    by Nick about October 5, 2012 Best answer

    Thanks for sharing this, Paul!

    A lot of people ask how to get configure the editor.

  • 4

    by Amr Ibrahim about November 25, 2012

    I made the editings, now I get the buttons but some of the icons are not appearing, what might be the reason?!

     

    bug

    • Score: 0
Question was closed.