Several css styles

Author Message

Catherine Mollet @work

Monday 14 September 2009 5:15:58 am

Hello,
I don't know if it's possible unless I didn't find answer, but how could I apply several css classes to one element ? Let me explain : I have a top page with a h2 as first thing. I would like that this h2 have a specific color, for example red, created in the css file like

     h2.red {color: red;}
 

and as it's at the top of the page, that it doesn't have any top margin, different to other h2

     h2.pagetop {margin-top: 0;}
 

How is it possible to have at the end something like

     <h2 class="red pagetop">My title</top>
 

With the [header] tag, I'm only able to select one css style.

Thank you.

Łukasz Serwatka

Monday 14 September 2009 6:23:49 am

This looks like candidate for an enhancement in OE to support multiselect box. You can try disable OE and input that class manually like: <header class="red blue">text

Make sure you have defined that classes in content.ini.append.php

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

Catherine Mollet @work

Monday 14 September 2009 8:50:43 am

Thanks for your answer. Sure it would be a useful enhancement :-)
In the meanwhile, I will try your solution.
(Classes are already defined !)

Catherine Mollet @work

Tuesday 15 September 2009 1:59:49 am

Too bad, Lukasz's solution doesn't work :-(
Error message is :

The draft could not be stored.
Required data is either missing or is invalid:
* Body: Class 'red pagetop' is not allowed for element <header> (check content.ini).

Another great enhancement of eZ would be the possibility to add <div> in OE !

Łukasz Serwatka

Tuesday 15 September 2009 2:22:31 am

Yes, I have checked that too. That explains why multi-select box was not used. Feel free to fill up enhancement request if does not exists yet.

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

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 05:09:44
Script start
Timing: Jan 18 2025 05:09:44
Module start 'layout'
Timing: Jan 18 2025 05:09:44
Module start 'content'
Timing: Jan 18 2025 05:09:45
Module end 'content'
Timing: Jan 18 2025 05:09:45
Script end

Main resources:

Total runtime1.1179 sec
Peak memory usage4,096.0000 KB
Database Queries63

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0042 587.8906152.6094
Module start 'layout' 0.00420.0028 740.500039.4141
Module start 'content' 0.00701.1094 779.9141564.7344
Module end 'content' 1.11630.0016 1,344.648412.1875
Script end 1.1179  1,356.8359 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00490.4340160.0003
Check MTime0.00120.1086160.0001
Mysql Total
Database connection0.00050.045510.0005
Mysqli_queries1.059494.7652630.0168
Looping result0.00060.0521610.0000
Template Total1.076596.320.5382
Template load0.00440.391920.0022
Template processing1.072195.899120.5360
Template load and register function0.00020.014010.0002
states
state_id_array0.00250.220810.0025
state_identifier_array0.00140.124420.0007
Override
Cache load0.00370.3305330.0001
Sytem overhead
Fetch class attribute can translate value0.00050.048920.0003
Fetch class attribute name0.00100.090060.0002
XML
Image XML parsing0.00080.073620.0004
class_abstraction
Instantiating content class attribute0.00000.001670.0000
General
dbfile0.00080.0751180.0000
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/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/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: 27
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs