Results 1 to 4 of 4

Thread: News: How to disable TinyMCE for teaser text

  1. #1
    User
    Join Date
    06-19-09.
    Posts
    106

    Default News: How to disable TinyMCE for teaser text

    Hi everyone,

    I wonder how I can disable TinyMCE for the news teaser text. Although not essential, I'd like to do it update-proof if possible (so that I don't need to re-implement it after updating to a new Contao version).

    Can anyone give me an idea? Many thanks!

  2. #2
    User Andreas's Avatar
    Join Date
    07-11-09.
    Location
    Mönchengladbach
    Posts
    499

    Default

    Put this into system/config/dcaconfig.php
    PHP Code:
    $GLOBALS['TL_DCA']['tl_news']['fields']['teaser']['eval']['rte'] = '';
    // or this one
    unset($GLOBALS['TL_DCA']['tl_news']['fields']['teaser']['eval']['rte']); 
    This is update proof.

    You also can setup your own system/config/tinyMCE.php e.g. tinyCustom.php, then you have to use this.
    PHP Code:
    $GLOBALS['TL_DCA']['tl_news']['fields']['teaser']['eval']['rte'] = 'tinyCustom'
    If you want to change all tinyMCE.php with tinyCustom.php you can use this one.
    PHP Code:
    // use tinyCustom for all textareas that use tinyMCE
    array_walk_recursive($GLOBALS['TL_DCA'], function(&$v$k){
      if(
    $k === 'rte' && $v === 'tinyMCE')
      {
        
    $v 'tinyCustom';
      }
    }); 
    Web-Development, Freelancer, Burgtech, XHTML, HTML5, CSS, PHP, Javascript, MooTools, MySQL and more
    Amazon wishlist

  3. #3
    User
    Join Date
    06-19-09.
    Posts
    106

    Default

    Thank you so much, disabling the editor works great!

    I've also tried your code for TinyCustom, but when I use it the toolbar appears twice for some reason. This is not the case when I use the same customised file as tinyMCE.php. Any idea?

  4. #4
    User
    Join Date
    06-19-09.
    Posts
    106

    Default

    Quote Originally Posted by spirelli View Post
    Thank you so much, disabling the editor works great!

    I've also tried your code for TinyCustom, but when I use it the toolbar appears twice for some reason. This is not the case when I use the same customised file as tinyMCE.php. Any idea?
    tried again and now it seems to work. Cheers.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •