Set TinyMCE to Advance and paste config code with package install

Permalink
Hi there,

I have a file that holds a default configuration for the TinyMCE editor and when I click Advance I then paste this into the textarea provided. This works perfectly fine, but I am just wondering if there is a way I can automate this process when installing a package?

Is there a core file I can override or a database field I can change to achieve this. Any help would be greatly appreciated.

Regards,
mat

mbaxter91288
 
mbaxter91288 replied on at Permalink Best Answer Reply
mbaxter91288
OK anyone finding this I figured it out. After digging around the core of Concrete5 I found this solution. Please let me know if there is a better way to achieve this.

In your package install function add:

Config::save('CONTENTS_TXT_EDITOR_MODE', 'CUSTOM');
Config::save('CONTENTS_TXT_EDITOR_CUSTOM_CODE', $this->get_txt_editor_default());


and then the get_txt_editor_default() function (can be named anything) must be within your controller and contain the following (this is basically the same function found in core/controllers/single_pages/dashboard/system/basics/edior.php):

function get_txt_editor_default(){ 
   ob_start();
   ?>
*YOUR EDITOR CONFIG HERE*   
   <?php    
   $js=ob_get_contents();
   ob_end_clean();
   return $js;
}


Well hopefully someone will find it usefull.

Cheers,
Mat