Forums / Developer / ezxml and css

ezxml and css

Author Message

Paul Forsyth

Thursday 25 September 2003 4:18:15 am

Using 3.2 and i want to add class tags to text in my xml field. My old 3.1 documentation states this can be done but i know find that it cant be done. Looking at the ezxmltag files verifies this for 3.2 and looking back at 3.1 i see it never has.

I remember adding to this thread a while back about the same issue but i now see i was wrong:

http://ez.no/content/view/full/28923

Is there going to be support for css in xml fields *outside* of custom tags.... I cant hardcode fields in for my site...

Paul

Paul Borgermans

Thursday 25 September 2003 6:11:00 am

Yes,

All tags can now have a class, but you have to declare it in the ini file. The "class" is a bit misleading here, it is more general than a css class style.

So you need to define the classes in the ini file, then create a template where you use this class (and add it to the override.ini.append). In your template you can do many things with the class value. The straight forward thing is to associate it with a css class style, but you are not limited to that. You can also modify the template for the xml element and use a switch to do whatever you want based on its value.

hth

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Paul Forsyth

Thursday 25 September 2003 10:09:54 am

It is a little misleading. Since the doco mentions that the class is let through to the template as {$classification} maybe the tag should be called 'classification' instead of 'class'.

I've opted for the custom tag approach. All i needed was a way of applying some css to a paragraph. None of the current tags supported by ezxml tackle this.

Was there a reason to exclude the <p> tag from ezxml?

I know paragraphs are there by default but i can't use another tag as it carries some form of formatting with it (<strong><em> etc). I could use <table> but it is overkill just to wrap some text up and would confuse users building with it.

Paul

Alex Jones

Thursday 25 September 2003 10:56:09 am

Any reason you couldn't use a span?

Alex

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

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

Paul Forsyth

Friday 26 September 2003 12:28:26 am

Ahem, yes a span or div would be better than p. p implies more formatting than the other two :)

paul