Forums / Setup & design / why css class attribute dont work in xml tags ?
Lida Popelo
Sunday 05 September 2004 3:45:24 am
In xml textfield i try to apply css class to tag <emphasize>, but it doesn't work.
In xml text field i have:
<emphasize class="my_css_class"> Something </emphasize>
In resulting html i have:
<i> Something </i>
Eivind Marienborg
Sunday 05 September 2004 4:38:40 am
An <emphasize> isn't a tag you can assign a class or id to. An emphasize is a tag to make the text italic, so assigning a class to it would be rather meaningless.
Eivind
Alex Jones
Sunday 05 September 2004 6:53:59 am
Lida, it is possible, try
<em [class="my_css_class"]>Emphasized text.</em>
Eivind, there may well be instances where you want one emphasize tag to appear different than another (perhaps a color, or font weight change. So, it is a valid request.
XML Tag Documentation: http://ez.no/ez_publish/documentation/reference/xml_tags
Alex [ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ] <i>When in doubt, clear the cache.</i>
Sunday 05 September 2004 7:00:37 am
Thanks, i tried it but tag <em class="my_css_class">Something</em> automaticaly replaces with tag <emphatsize class="my_css_class">Something</emphatsize> after i click publish button, and my_css_class doesn't applys to "Something"
Sunday 05 September 2004 10:08:19 am
Alex: Of course, sorry, I didn't think of that. Even though in that case I would create a span, and apply both the italic and the color to that in stead.
Bruce Morrison
Sunday 05 September 2004 4:10:58 pm
This issue may be due to many of the templates in design/standard/templates/content/datatype/view/ezxmltagsmissing the code required to produce the class attribute in the output.
{section show=ne($classification,'')} class="{$classification}"{/section}
It looks as if this code is only availiale for table tags (table.tpl, th.tpl and td.tpl)
It appears that this has been added in to the SVN versionhttp://pubsvn.ez.no/websvn/listing.php?repname=nextgen&path=%2Ftrunk%2Fdesign%2Fstandard%2Ftemplates%2Fcontent%2Fdatatype%2Fview%2Fezxmltags%2F&rev=0&sc=1
The files from above location should be able to be copied over your existing ones.
CheersBruce
My Blog: http://www.stuffandcontent.com/ Follow me on twitter: http://twitter.com/brucemorrison Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish
Tuesday 07 September 2004 6:26:15 am
Eivind, that is totally understandable. CSS is still new enough that we all think of it in slightly different ways. :)
Bruce, good call, I hadn't even thought of that.