This project is read-only.

Format options in TinyMCE? (theme_advanced_blockformats, what else?)

Dec 2, 2008 at 8:39 AM
* How do I add styles to the block format dropdown in TinyMCE?
* Is it possible to have inline styles beyond B (strong), and I (em) or maybe have separate buttons for I and EM?

In the source project I've found the files:

I haven't understod where the correct place of adding formats is, and if I need to tell the editor if it's a css-style or a tag.
I have tried adding the following to web.config.
            <tinyMCE enabled="true" cssUrl="/edit/css/editor.css">
                    <add key="theme_advanced_blockformats" value="teststyle,code,p,address,pre,h1,h2,h3,h4,h5,h6"/>

It seems to get me halfway. "code" is added to the dropdown. teststyle is not. I was guessing the langs/en.js but it seems to have no effect on getting the style showing? Maybe it's used in a later step?

About inline styles, I need to have a coloured emphasis style along with the usual bold and italic. Is it possible within reasonable configuration?

(I'll happily add whatever I find on this subject to the doc-wiki.)
Dec 2, 2008 at 9:09 AM
I found the option theme_advanced_disable in N2/Resources/FreeTextArea.js. There is an option in the list called styleselect. (theme_advanced_disable : 'help,fontselect,fontsizeselect,forecolor,backcolor,styleselect')
Thus I added <add key="theme_advanced_disable" value="help,fontselect,fontsizeselect,forecolor,backcolor"/> to edit/tinyMCE/settings in web.config.
That made a style select dropdown show up! :)
Now it's empty, but it guess it the one who tries to retrieve the stylesheet from /Edit/css/editor.css. According to firebug something is calling that either way. However it's not using the site root but the web root. The link should be more like /MySite/Edit/css/editor.css.
I'll keep digging around.
Dec 2, 2008 at 9:14 AM
Found that one right away...
Overridden in web.config by me.. oops.
<tinyMCE enabled="true" cssUrl="~/edit/css/editor.css">
cssUrl points out the editor.
..and it picks up the styles. Excellent.

Time to write some wiki-docs. :)