This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Developer » Online editor: css and customattributes
expandshrink

Online editor: css and customattributes

Online editor: css and customattributes

Thursday 27 October 2011 10:20:57 am - 3 replies

To make it more clear to content editors what they are working on, it would be very helpful if tag attributes in the online editor could be styled using css: e.g.

 <custom name="somecustomtag" custom:level="A" >some text</custom>

appears in the online editor as:

 <div customattributes="level|A" type="custom" class="ezoeItemCustomTag somecustomtag"><p>Some text</p></div>

Suppose there are two levels: 'A' and 'B', where 'A' could then appear as a blue box, and 'B' as a green box in the online editor. Another option would be to use a different background image.

Is this possible at all in the online editor? I suppose CustomAttributeStyleMap has something to do with it, but being able to add color or background images to it would be very useful.

Monday 31 October 2011 10:40:43 am

Hi Sebastiaan, 

I see the question was marked as solved : have you found the answer to this ? Worth sharing i'd say, this is a useful feature of custom attributes.

Cheers !

Monday 31 October 2011 10:59:55 am

Hmm - strange. Not solved yet - but working on a possible solution. Will post update here.

Thursday 03 November 2011 8:57:07 pm

If your editors use browsers that support CSS3 selectors you could add some rules to a custom online editor stylesheet like this:

settings/design.ini.append.php:

[StylesheetSettings]
EditorCSSFileList[]=custom.css

design/stylesheets/custom.css:

div.somecustomtag[customattributes*="level|A"] {
    background:#f00;
}

Modified on Thursday 03 November 2011 8:58:03 pm by STEVO +

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from