How to center a text in online editor

Author Message

christian bencivenni

Tuesday 31 March 2009 7:43:17 am

Someone can help me to solve this without template override?

Gabriel Finkelstein

Tuesday 31 March 2009 10:23:25 am

You have to add a custom class for the paragraph tag.
In content.ini from both your admin and public siteaccess add:

[paragraph]
AvailableClasses[]
AvailableClasses[]=textCenter

And then in your stylesheet:

p.textCenter {
   text-align:center;
}

André R.

Tuesday 31 March 2009 1:29:47 pm

In 4.1 you have support for alignment out of the box on paragraph|table|td|th|custom|embed tags, so you will not need the above code to accomplish alignment(but it will work there as well, just not inside editor unless you define that css in editor .css file).

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

Neo Pixel

Friday 03 April 2009 1:29:30 am

I still don't see why "align text left" "align text center" & "align text right" isn't standard functionality in the online editor...

Three buttons in a row is what you get with word, so what's the problem?

Apart from that and other minor problems, ezpublish is the best cms I've used :-)

Asking stupid questions so you don't have to!

André R.

Friday 03 April 2009 6:29:52 am

I answered this in another forum post, the buttons are there, just not enabled by default in OE 5.0.0, this is fixed in next version of OE witch will be bundled with eZ Publish 4.1.1.

If you use 4.1.0, look in ezoe.ini for how to enable them yourself.

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

Neo Pixel

Monday 06 April 2009 6:22:12 am

Great stuff! :-)

Is OE 5.0.0 compatible with 4.0.X ???

Asking stupid questions so you don't have to!

André R.

Monday 06 April 2009 7:26:03 am

Yes, but the alignment is not(so disabled if you install on 4.0.x).

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

Anca Grozea

Thursday 09 April 2009 7:01:37 am

Thank you Gabriel!
Very useful post!

Have a nice day!
Anca

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 18 2025 11:45:15
Script start
Timing: Jan 18 2025 11:45:15
Module start 'layout'
Timing: Jan 18 2025 11:45:15
Module start 'content'
Timing: Jan 18 2025 11:45:16
Module end 'content'
Timing: Jan 18 2025 11:45:16
Script end

Main resources:

Total runtime1.0356 sec
Peak memory usage4,096.0000 KB
Database Queries78

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0045 587.9297152.6250
Module start 'layout' 0.00450.0040 740.554739.4453
Module start 'content' 0.00861.0256 780.0000706.6172
Module end 'content' 1.03410.0015 1,486.617220.1563
Script end 1.0356  1,506.7734 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.3355160.0002
Check MTime0.00170.1619160.0001
Mysql Total
Database connection0.00070.066410.0007
Mysqli_queries0.964393.1111780.0124
Looping result0.00100.1004760.0000
Template Total1.000696.620.5003
Template load0.00270.264820.0014
Template processing0.997896.350020.4989
Template load and register function0.00040.034310.0004
states
state_id_array0.00110.104610.0011
state_identifier_array0.00160.159020.0008
Override
Cache load0.00250.2430350.0001
Sytem overhead
Fetch class attribute can translate value0.00120.119650.0002
Fetch class attribute name0.00120.1188110.0001
XML
Image XML parsing0.00180.169650.0004
class_abstraction
Instantiating content class attribute0.00000.0029140.0000
General
dbfile0.00110.1033300.0000
String conversion0.00000.001040.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
8content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
6content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 31
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs