[TYPO3-RTE] Is it possible to add new button for some special char

Stanislas Rolland typo3 at sjbr.ca
Sat Oct 18 18:07:40 CEST 2008


Hi Styrmir,
> 
> I was wondering if I could add two new button to the RTE of TYPO3. I am
> thinking of the buttons to add quoted sentence, because in Icelandic we
> don't use "hello" we use „hello“. I have seen this solved as a buttons
> in RTE at a internet newspaper homepage (not TYPO3 page).
> My question is if this is possible without massive PHP programming of 
> the extension.
> 
It is possible and rather easy to add a button in the RTE. There is a 
simple example on TER: 
http://typo3.org/extensions/repository/view/rtehtmlarea_dummyplugin/current/

The API for doing so is also on TER: 
http://typo3.org/documentation/document-library/extension-manuals/rtehtmlarea_api_manual/1.7.4/view/

However, here is a nicer solution for your quoting issue:

1. add the following lines to your css file:

q { quotes: '„' '“'; }
q:before { content: open-quote; }
q:after { content: close-quote; }

2. Clear your browser cache so that the new css file takes affect

3. Using the Extension Manager, check the checkbox „Enable additional 
inline elements“ in htmlARea RTE configuration

Now, in the RTE, you should see a bunch of new buttons (that you can 
disable individually in Page TSCOnfig with RTE.default.hideButtons, see 
the manual for the names of the buttons).

The button of interest for you is q (Short inline quotation). If you 
select some text in the RTE and press the q button, the text will be 
quoted with the quotes you just defined in your css file. If you put 
your cursor inside the quotation, the q button lights up. If you press 
it, the quotes are removed.

You could also do it for blockquote (Large quotation) with the following 
in your css file:

blockquote { quotes: '„' '“'; }
blockquote:before { content: open-quote; }
blockquote:after { content: close-quote; }

When you just want to write about those quotes in the RTE, you can use 
the character map button to insert one or the other of these quotation 
marks.

Kind regards,
Stanislas


More information about the TYPO3-project-rte mailing list