Forums / Extensions / EzOE with Tiny MCE changes

EzOE with Tiny MCE changes

Author Message

Håkan Bergman

Monday 10 May 2010 5:09:34 am

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

André R.

Monday 10 May 2010 2: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> 

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

eZ debug

Timing: Jan 18 2025 02:58:06
Script start
Timing: Jan 18 2025 02:58:06
Module start 'content'
Timing: Jan 18 2025 02:58:06
Module end 'content'
Timing: Jan 18 2025 02:58:06
Script end

Main resources:

Total runtime0.5850 sec
Peak memory usage4,096.0000 KB
Database Queries191

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 589.1406180.8359
Module start 'content' 0.00520.4782 769.9766544.7422
Module end 'content' 0.48340.1015 1,314.7188336.7500
Script end 0.5849  1,651.4688 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.6393210.0002
Check MTime0.00140.2387210.0001
Mysql Total
Database connection0.00070.119910.0007
Mysqli_queries0.524889.71441910.0027
Looping result0.00140.24411890.0000
Template Total0.558195.420.2790
Template load0.00200.345520.0010
Template processing0.556195.055020.2780
Template load and register function0.00010.020010.0001
states
state_id_array0.00110.196410.0011
state_identifier_array0.00070.121220.0004
Override
Cache load0.00160.2801200.0001
Sytem overhead
Fetch class attribute can translate value0.00100.164130.0003
Fetch class attribute name0.00080.137930.0003
XML
Image XML parsing0.00090.147130.0003
class_abstraction
Instantiating content class attribute0.00000.001030.0000
General
dbfile0.00390.6612280.0001
String conversion0.00000.001030.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs