Customizing EZ Online Editor

Author Message

Hakim Bouras

Friday 18 November 2005 11:06:29 am

How can I add features for the end users such as: justifying the text or selecting the color of the text?

Also how are we suppose to use the "wordmatch.ini" file to enable text pasted from Word?

And finally how can modulate/customize what will be accepted or not in an XMLbloc (tag and attribute)?

Thank you for your help
Hakim

Kirill Subbotin

Monday 21 November 2005 2:51:01 am

>Justifying the text or selecting the color of the text?

Its impossible to do it directly in current realization, although you can use templates and css classes to implement it on your site. For justifying text you can use your special custom tag and render it as justified text using template. (placed in /templates/content/datatype/view/ezxmltags directory in your site design)

> Also how are we suppose to use the "wordmatch.ini" file to enable text pasted from Word?

You can paste from Word without any additional settings. 'wordmatch.ini' is an advanced feature intended to keep additional Word styling information and translate it in order to use in your site design. In fact it searches the given string inside HTML pasted from Word and if matches it adds the corresponding class attribute to your XML tag.

I don't know where user should get those strings, the possible way to do it is to view Word's clipboard result in HTML format. I think we will add debug output of the input data, so you can view it and copy those strings.

But anyway now this is more like backward-compatiblity feature, we will review it in future releases of OE.

> And finally how can modulate/customize what will be accepted or not in an XMLbloc (tag and attribute)?

Currently it's impossible, although I think these features will be implemented in ez publish 4.

Ɓukasz Serwatka

Monday 21 November 2005 4:07:04 am

Hakim, don't cross post please. One message deleted due to cross posting.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Hakim Bouras

Monday 21 November 2005 7:45:02 am

Kirill,

Thanks for your answer. I found a way for the editor to do a part of what I want (by updating the "ezeditor.js" file). But, the text justification is lost, when the content is saved in the XML block.
Do you know what php code (and where) is used to clean the content received in the XML Block?

Lukasz,

Sorry for the cross post, but since I did not get answers, I thought it was maybe not the right place. I'll be more patient in the future.

Kirill Subbotin

Tuesday 22 November 2005 8:36:06 am

It is done in /ezxmltext/handlers/input/ ezdhtmlxmlinput.php

It will be much better if you use OE 4.0 alpha, cause we have rewritten this part there and its much easier to manage now.

Kirill Subbotin

Tuesday 22 November 2005 8:39:16 am

To correctly implement this you have to set new conversion rules html -> eZXML.

Also not only the input part, but the output to the edit window should be updated. (in the same file)

Hakim Bouras

Tuesday 22 November 2005 9:04:56 am

I had a quick look to this file and was a bit afraid of going through these more than 4000 lines of code...

Would it be possible for you to give some clues to exactly know what methods need to be changed and where in order to:
- allow a tag (ie: <FONT> tag)
- allow an attribute (ie: color="red" - color attribute)

Thanks for your help,
Hakim

Kirill Subbotin

Tuesday 22 November 2005 9:18:11 am

You can't just "allow" a tag. You can only convert it to a one of ezxml tags.
Allowing an attribute is simple if you are using oe 4.0.

Hakim Bouras

Tuesday 22 November 2005 9:38:58 am

Then, would it be possible for you to give some clues to exactly know what methods need to be changed and where in order to:
- convert a tag (ie: <FONT> tag)
- allow an attribute with oe 4.0 (ie: color="red" - color attribute)

Thanks

Kirill Subbotin

Wednesday 23 November 2005 3:08:05 am

You can convert 'font' tag to 'custom' with specific attributes.

To do this:
In the $InputTags array, add element:
'font' => array( 'name' => 'custom' ),

In the $OutputTags array find definition of the 'custom' tag, here you should add new conversion rules for the attributes, for example 'style' => 'custom:style', which means that style attribute of the font tag will be converted to 'custom:style' attribute of custom tag.

To find out which tags and attributes come from the input and what is actually stored you can add debug output to the validateInput function. I think just uncomment these lines:
eZDebug::writeDebug( $text, 'HTML input' );
eZDebug::writeDebug( $myDomString, 'converted eZXML' );

Also you should correct rendering of the custom tag in the inputTagXML function.

Kirill Subbotin

Wednesday 23 November 2005 3:16:03 am

Also you should add a 'name' attribute to your custom tag converted from 'font' tag. For example you want the name "font".

One of easiest ways to do this is to add 'title' attribute to the font tag in the javascript part. Then it will be automatically converted to a 'name'. (see $OutputTags for the converting rules).

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 19 2025 00:09:53
Script start
Timing: Jan 19 2025 00:09:53
Module start 'layout'
Timing: Jan 19 2025 00:09:53
Module start 'content'
Timing: Jan 19 2025 00:09:54
Module end 'content'
Timing: Jan 19 2025 00:09:54
Script end

Main resources:

Total runtime1.3803 sec
Peak memory usage4,096.0000 KB
Database Queries83

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0063 587.9141152.6250
Module start 'layout' 0.00630.0025 740.539139.4453
Module start 'content' 0.00881.3699 779.9844675.8906
Module end 'content' 1.37870.0016 1,455.875024.1641
Script end 1.3803  1,480.0391 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.2519160.0002
Check MTime0.00160.1123160.0001
Mysql Total
Database connection0.00120.089010.0012
Mysqli_queries1.287793.2852830.0155
Looping result0.00090.0654810.0000
Template Total1.341797.220.6708
Template load0.00260.186620.0013
Template processing1.339197.010120.6695
Template load and register function0.00010.009110.0001
states
state_id_array0.00100.073610.0010
state_identifier_array0.00450.328820.0023
Override
Cache load0.00230.1680640.0000
Sytem overhead
Fetch class attribute can translate value0.00060.041730.0002
Fetch class attribute name0.00130.0923130.0001
XML
Image XML parsing0.00230.163630.0008
class_abstraction
Instantiating content class attribute0.00000.0027160.0000
General
dbfile0.00210.1489240.0001
String conversion0.00000.000540.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
11content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
17content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
8content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 43
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs