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 » Changing text and background color of...
expandshrink

Changing text and background color of a td / th

Changing text and background color of a td / th

Tuesday 22 November 2011 7:37:31 am - 1 reply

Hi,

I followed the tutorial http://serwatka.net/blog/custom_attributes_and_the_color_picker_in_the_online_editor_5_0

and was able to change the text color. I am stuck with how to change the background color.

I followed the following steps:

Added the following section to (settings/override/content.ini.append.php)
        AvailableCustomTags[]=span
        IsInline[span]=true
            under [CustomTagSettings]       
           Then added:
       [span]
       CustomAttributes[]=color
       CustomAttributesDefaults[color]=#FF0000
       CustomAttributes[]=background-color
       CustomAttributesDefaults[background-color]=#000000
Added the following section to the file (settings/override/ezoe_attributes.ini.append.php)
        [CustomAttribute_span_color]
        Name=Forecolor
        Type=color
       [CustomAttribute_span_background-color]
       Name=Backcolor
       Type=color
Created the file span.tpl (extension/bdaf/design/bdaf/templates/content/datatype/view/ezxmltags/span.tpl

I am stuck in this section:         <span {if is_set( $color )}style="color: {$color};background-color: {$xxx}"{/if}>{$content}</span>

 

Any help would be greatly appreciated.

Wednesday 14 August 2013 5:15:35 pm

Hi,

I was too working on something like that, I'm afraid I won't help a lot plus this is a very old topic.

But I find a far far easier way to add color on text in ezoe, more simple than creating a custom attribute.

 

There's only one thing to do, create the ezoe.ini.append.php in your extension settings and put this in:

[EditorLayout]

Buttons[style]=formatselect,bold,italic,forecolor

Buttons style can be richer but if you add forecolor you avec a nice native color picker. 

 

It took me long to find out so I needed to share it.

 

cheers

PS: I'm sorry but I didn't manage to do the same for the background if I do I'll share it!

Modified on Wednesday 14 August 2013 5:16:43 pm by Pitou Sebastien

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from