tt_news

1.5.5. The Rich-Text-Editor

I recommend to use the extension "htmlarea RTE" (extkey: rtehtmlarea) instead of the RTE (extkey: rte) which is included in your TYPO3 package. One big advantage of rtehtmlarea is, that it works on almost all browsers and operating systems. The classic RTE works only in Internet Explorer because it depends on some ActiveX-controls which are (fortenutely) not available in other browsers.  

Since tt_news v1.4.2 the RichText-Editor for news is configured like the RTE for normal content (e.g. Text, Text w/image). This is done at three places:

1. By this line in tca.php:

  [line: 405]
  '0' => Array('showitem' => 'title,type;;1;;,datetime;;2;;1-1-1,author;;3;;,short,bodytext;;4;
  richtext[paste|bold|italic|underline|formatblock|class|left|center|right|orderedlist|unorderedlist|
  outdent|indent|link|table|image]:rte_transform[flag=rte_enabled|mode=ts];4-4-4,no_auto_pb,
  --div--;Relations,category,image;;;;1-1-1,imagecaption;;5;;,links;;;;2-2-2,related;;;;3-3-3,
news_files;;;;4-4-4'
),

which confgures which buttons or features will be available in the RTE-interface and it sets also the basic "transformation mode" (mode=ts). The transformation mode defines how the content of the field is changed while storing it in the database and while getting it back from the database. A nice graphic that shows how and where transformations work, can be found on this page: http://typo3.org/documentation/document-library/core-documentation/doc_core_api/4.0.0/view/5/2/

2. If the extension "css_styled_content" is enabled, the transformation mode is changed to "ts_css" by adding this lines as "default pageTSconfig":

  # RTE mode in table "tt_news"
  RTE.config.tt_news.bodytext.proc.overruleMode=ts_css

This mode enables the use of CSS-classes for formatting the contents of the news record (e.g. HTML-lists will be generated with tags like <ul>,<li> and <ol>, headers will be rendered as <h1> - <h6>... for a detailed view on the changes between the different transformation modes take a look at this page: http://typo3.org/documentation/document-library/core-documentation/doc_core_api/4.0.0/view/5/2/#id2828212  

3. The third part of the RTE configuration is done by this line in the file static/ts_new/setup.txt or static/ts_old/setup.txt in the extension dir (the settings in these files will be enabled by adding one of them as "static templates from extensions" to your TS template):

  plugin.tt_news.general_stdWrap {
      parseFunc < tt_content.text.20.parseFunc
  }

The "general_stdWrap" is used additionally to the normal standardWraps (f.e. subheader_stdWrap) for the following fields: "author", "subheader", "text" and "links". That means, the processing of these fields can be changed by modifying one line of TypoScript. If this behaviour is not wanted for a certain site, it can be disabled by clearing the "parseFunc":

  plugin.tt_news.general_stdWrap {
      parseFunc >
  }

But then you'll have to add a "parseFunc" to every field which contents should be processed (f.e. to find mailadresses in the text and add <a href="mailto:..." to them).

"< tt_content.text.20.parseFunc" means, that the parseFunc-configuration from the field "text" from tt_content is also taken  for the tt_news-fields which are processed by the "general_stdWrap". If you want to change the configuration of "tt_content.text.20.parseFunc", open this value in the "TypoScript Object Browser" (see screenshot at the begĂ­nning of the section "Reference").   

 

If you want to change the appearance of the RTE in BE forms, you can overwrite the default settings in "page TSconfig". To see the current TSconfig settings for your site, you can use the tool: "View TS config fields content" from "Web>Info, page TSconfig".


The RTE configuration can also be changed by  "RTE.default" settings added by other extensions. If you have the extension "CSS_styled_content" installed, and you did not change the default setting: "Set PageTSconfig by default=on", this value will overwrite the transform settings for tt_news given in tca.php (the codeline above).

The following table shows the pageTSconfig settings for the site, from the screenshot above ("RTE.default" means that in this site the RTE processing for tt_news is configured like the processing for tt_content). All settings are done in the page "tt_news example 1" (is root-page). The sysfolder for news is located under this page, so the settings from the "root-page" will also affect this folder.  

Template settings

EXT:css_styled_content

Add to Page TS-config:

content(default)

Installed

  RTE.default {
    proc {
      preserveTables = 1
      overruleMode = ts
    }
  }

content(default)

Not installed, or pageTS config not added by default.

  RTE.default {
    proc {
      preserveTables = 1
      overruleMode = ts
    }
    showButtons = table
  }

css_styled_content

Installed

no special settings needed. The "overrule mode" is added to the default pageTSconfig.

 

Notice:
If your news sysfolders are not located under your website's "root-page" you'll have to add the settings from the table above to the PageTSconfig of your news sysfolders.

Example:

The settings that start with "RTE.default" will affect the RTE for tt_news and tt_content (and all RTEs from other extensions). If you want to configure the RTE for tt_news different from the RTE for tt_content, the syntax looks like this (pageTSconfig):

  RTE.config.tt_news.bodytext {
    proc {
      preserveTables = 1
      overruleMode = ts_css
    }
    showButtons = textcolor,bgcolor
  }

for further details see:

http://typo3.org/documentation/document-library/rtehtmlarea/

http://typo3.org/documentation/document-library/extension-manuals/rtehtmlarea/current/

http://typo3.org/documentation/tips-tricks/customizing-the-rich-text-editor/

http://typo3.org/documentation/document-library/core-documentation/doc_core_api/4.0.0/view/5/1/

To top


Valid XHTML 1.0!