css styles and xmltext

Author Message

Trond Åge Kvalø

Wednesday 03 March 2004 10:47:56 am

What do I need to do to use css styles in the different tags in the xml-textfields.

According to the online editor documentation I have to place the styles in the content.ini file. Knowing that you don't mess with the original files I created an content.ini.append in my settings directory and put the following lines there
[ul]
AvailableStyles=mystyle

but that didn't work. So I edited the original content.ini, and that didn't work either.
Does anyone know what I've done wrong?

Is it true that I can only use css styles for a few tags like <ol> <ul> <table> and so on?

What about the <p> tag? I need to be able to use css styles for them as well, what shall I do to make that happen.

I'm using version 3.3-3 now.

Best regards
Trond Kvalo

trondåge

Paul Forsyth

Wednesday 03 March 2004 11:13:03 am

According to the main content ini file the format is:

[ul]
AvailableClasses[]=ulRed
AvailableClasses[]=ulBlue

and not AvailableStyles. Try this.

It is true the default paragraph xml template doesnt include anything for classification. But you could override this with your own that does include a classification field. The same goes with any other template you need to change.

paul

Alex Jones

Wednesday 03 March 2004 11:20:12 am

Trond, ultimately you can use CSS to style almost any tag you would like, so that shouldn't be an issue.

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Clay Pereira

Wednesday 03 March 2004 3:43:07 pm

Hi the solution is actually very simple. Just modify your exml datatype tags to include the $classification variable. Then you can use any class. For example:

I modified the standard strong.tpl template as follows:
standard/templates/content/datatype/view/ezxmltags/strong.tpl

<b class="{$classification}">{$content} </b>

Now inside my xml txt field i can call my blue font class:
<strong class="bluefont"> Something Blue</strong>

I hope this helps.
clay

Trond Åge Kvalø

Thursday 04 March 2004 12:48:07 am

Thanks guys, I really appreciate your help.

Paul, The AvailableStyles was a typo, I copied the line above end edited the name of the classes, so that shouldn't be it. We're talking about the main content.ini file here right?

I thought maybe a bit more information could be in place.

We're building an e-learning portal for a local branch of Hydro, the oil company. They have to follow certain corporate design rules. So they have provided us with a their corporate stylesheet, so I need to make all my text follow this stylesheet.

So in order to achieve this I must edit the templates in content/datatype/view/ezxmltags so that they contain class="{$classification}". Then I must copy all of my stylenames from the corporate stylesheet into content.ini.

Is this the correct procedure? Or have I misunderstood totally.

Best regards
Trond Kvalo

trondåge

Paul Forsyth

Thursday 04 March 2004 1:42:12 am

Trond,

You have it correct.

However, i would suggest creating override templates for those you are going to change, and also create an override content.ini.append file to include any extra classifcation settings you need to add.

It is much easier to manage and maintain only the changes you need :)

Most of your css styles will likely be used in regular templates, and a few in the ezxmltag templates, so hopefully you don't need to add too many to content.ini.

paul

Trond Åge Kvalø

Monday 22 March 2004 1:09:50 pm

Ok, can someone help me please.

I have copied the templates paragraph.tpl and ul.tpl from the standard design directory into my own design directory. I don't <b>have to</b> replicate the catalog structure from the standard design directory, do I?

the templates has been changed to

<p class="{$classification}"> <ul class="{$classification}">
{$content} and {$content}
</p> </ul>

in my content.ini.append I've put the following lines:

[ul]
AvailableClasses=coursedescription

[p]
AvailableClasses=body-main
AvailableClasses=header-sub
AvailableClasses=header-mid
AvailableClasses=img-caption

The funny (or frustrating depending on your view/mood/tiredness) thing is that I can use the [ul] styles, but not the [p] styles.

What have I done wrong? Do I need to change [p] into [paragraph]? (Although I think I've tried that too)

<RogerRabbitMode>Pllllllllllleeeeeeeattthhh</RogerRabbitMode> help me!

best regards
trondåge

trondåge

Leif Arne Storset

Tuesday 08 August 2006 2:50:21 am

It appears that the list of available classes in the Online Editor is hard-coded into ezeditor.js or ezmozillaeditor.js.

From ezeditor.js:996, OE version 4.1.1:

    toolbarTags += "<select id='" + this.objectRef + "_select_header' onChange=changeHeading('" + this.objectRef + "')>"
        + "   <option value='normal' selected>"+textStrings["Normal"]+"</option>\n"
        + "   <option value='Heading 1'>"+textStrings["Heading1"]+"</option>"
        + "   <option value='Heading 2'>"+textStrings["Heading2"]+"</option>"
        + "   <option value='Heading 3'>"+textStrings["Heading3"]+"</option>"
        + "   <option value='Heading 4'>"+textStrings["Heading4"]+"</option>"
        + "   <option value='Heading 5'>"+textStrings["Heading5"]+"</option>"
        + "   <option value='Heading 6'>"+textStrings["Heading6"]+"</option>"
        + "   </select>";

I hope that there are plans to enable extending the class list without hacking the JavaScript.

Leif Arne Storset

Vytautas Germanavičius

Saturday 31 March 2007 11:38:27 am

So, it still not possible to use my own defined css? :(

{set-block scope=root variable=cache_ttl}0{/set-block}

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 02:02:29
Script start
Timing: Jan 18 2025 02:02:29
Module start 'layout'
Timing: Jan 18 2025 02:02:29
Module start 'content'
Timing: Jan 18 2025 02:02:30
Module end 'content'
Timing: Jan 18 2025 02:02:30
Script end

Main resources:

Total runtime0.9845 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.0151 587.9063152.6250
Module start 'layout' 0.01510.0030 740.531339.4453
Module start 'content' 0.01810.9644 779.9766767.7734
Module end 'content' 0.98250.0020 1,547.750020.1719
Script end 0.9845  1,567.9219 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.3611160.0002
Check MTime0.00150.1496160.0001
Mysql Total
Database connection0.00180.187610.0018
Mysqli_queries0.888290.2116830.0107
Looping result0.00090.0909810.0000
Template Total0.939295.420.4696
Template load0.00200.207920.0010
Template processing0.937295.188920.4686
Template load and register function0.00030.032010.0003
states
state_id_array0.00200.205410.0020
state_identifier_array0.00170.172320.0008
Override
Cache load0.00190.1913720.0000
Sytem overhead
Fetch class attribute can translate value0.00090.087760.0001
Fetch class attribute name0.00160.1617120.0001
XML
Image XML parsing0.00240.240960.0004
class_abstraction
Instantiating content class attribute0.00000.0023120.0000
General
dbfile0.00330.3349280.0001
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
9content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
21content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
9content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 47
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs