Skip to content
This repository has been archived by the owner on Apr 21, 2021. It is now read-only.

tinyCumstom.php for all fields that use tinyMCE.php #366

Open
Aybee opened this issue Feb 3, 2016 · 4 comments
Open

tinyCumstom.php for all fields that use tinyMCE.php #366

Aybee opened this issue Feb 3, 2016 · 4 comments

Comments

@Aybee
Copy link
Contributor

Aybee commented Feb 3, 2016

Hello, mostly people wish that a tinyCustom.php gets used for all fields that actually use the tinyMCE.php configuration.

I think on this page https://docs.contao.org/books/cookbook/customizing-contao/customizing-tinymce.html we should add the solution for achieving this.

// Use tinyCustom.php for all textareas that use tinyMCE.php
if(is_file(TL_ROOT.'/system/config/tinyCustom.php'))
{
  array_walk_recursive($GLOBALS['TL_DCA'], function(&$v, $k){
    if($k === 'rte' && $v === 'tinyMCE')
    {
      $v = 'tinyCustom';
    }
  });
}
@aschempp
Copy link
Member

aschempp commented Feb 3, 2016

why would you use tinyCustom for everything and not just change tinyMCE ?

@Aybee
Copy link
Contributor Author

Aybee commented Feb 3, 2016

If I change tinyMCE.php, it's not update safe.

@fritzmg
Copy link
Contributor

fritzmg commented Apr 22, 2016

why would you use tinyCustom for everything and not just change tinyMCE ?

That's not recommended, since these changes will get lost during an update. The recommended way is described here in the official Contao cookbook: https://docs.contao.org/books/cookbook/customizing-contao/customizing-tinymce.html

@aschempp
Copy link
Member

Please create a pull request for the necessary changes, but make sure to follow PSR-2 coding style.

Also be aware that this is no longer necessary in Contao 4, as the tinyMCE file is now a template that will not be overwritten on update.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants