eZ Community » Forums » Extensions » EzOE with Tiny MCE changes
expandshrink

EzOE with Tiny MCE changes

EzOE with Tiny MCE changes

Monday 10 May 2010 2:09:34 pm - 1 reply

Hello,

I have been reading the guide for OE 5.x and I can't seem to find how selectfont works. The standard seem to have paragraph, quote, header 1-6. I checked the template and added something like "p2" but it shows like an empty row in the selected list.

I tried to add something just to see if / how it works and it didn't.
In the .tpl file in edit directory I added "p2" as a blockformat and also copied p as p2 in valid_elements just to see an output. The list is incremented by one line which is white with no text name. I want my "p2" to have name "imagetext" as a <p> tag with class "imagetext". I also want to rename "paragraph" to "brödtext" to make it easier for the users to know what to choose from, as the name paragraph is not clear of what kind of text that will be shown in the article.

Best regards,

Håkan Bergman

Monday 10 May 2010 11:16:44 pm

Don't know about selectfont, but formatselect is implemented like this in ez theme (only small changes to the original advance theme code to comment out unsupported html types). You would have finded it easily by searching for theme_advanced_blockformats, the setting I presume you changed:

 _createBlockFormats : function() {
var c, fmts = {
                p : 'advanced.paragraph',
                //address : 'advanced.address',
                pre : 'advanced.pre',
                h1 : 'advanced.h1',
                h2 : 'advanced.h2',
                h3 : 'advanced.h3',
                h4 : 'advanced.h4',
                h5 : 'advanced.h5',
                h6 : 'advanced.h6'/*,
                div : 'advanced.div',
                blockquote : 'advanced.blockquote',
                code : 'advanced.code',
                dt : 'advanced.dt',
                dd : 'advanced.dd',
                samp : 'advanced.samp'*/
            }, t = this;
        c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', cmd : 'FormatBlock'});
        if (c) {
            each(t.editor.getParam('theme_advanced_blockformats', t.settings.theme_advanced_blockformats, 'hash'), function(v, k)
            {
                c.add(t.editor.translate(k != v ? k : fmts[v]), v, {'class' : 'mce_formatPreview mce_' + v});
            });
        }

So to add new entries you'll have to hack the theme to add it to fmts.
But, classes are not supported, so' you'll have to hack both the theme and parts of TinyMCE to add support for that.
This is why I haven't bothered to customize it yet to be able to set it from ezoe.ini, without class support it is pretty pointless.

As for changing name of paragraph, that's simple(well, kind of). ezoe uses a ezjscore server call to handle eZ Publish to TinyMCE translation integration. And you can find the stuff doing it in ezoeServerFunctions::i18n():

 'paragraph' => ezi18n( 'design/standard/ezoe', "Paragraph"),

So unless you need to change it for eng-GB, you'll be able to override it with translation "override", basically overriding the string in a translation file in an extension that have higher priority then ezoe. ref:

<!DOCTYPE TS>
<TS>
<context>
 <name>design/standard/ezoe</name>
 <message>
        <source>Paragraph</source>
        <translation>Paragraf</translation>
</message>
</context>
</TS> 

Modified on Monday 10 May 2010 11:34:25 pm by André R

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from