Skip to main content
Level 4
Oct 16, 2015 2:29 AM UTC
Solved

style for selection

Hi,

Is there a way to set a style on each item of a selection component?

[img]style.png[/img]

The properties style, labelStyle and bodyStyle don't work.

Thanks

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
edubey
edubeyAccepted solution
Level 10
Oct 16, 2015 2:29 AM UTC

yes, you can use 'cls' property, but the it won't add styles on drop down. This class will be added to the parent div of it. So you need to target that particular drop down div.

12 replies

smacdonald2008
Level 10
Oct 16, 2015 2:29 AM UTC

Can you please provide more details - the CQ version and the steps you did to get here so we can attempt to reduplicate. Need to see if there is an issue or bug. 

Translate
edubey
Level 10
Oct 16, 2015 2:29 AM UTC

might be, as aem does not give any property to color those. But its possible to override default css and write your own as previously I mentioned.

Translate
Level 4
Oct 16, 2015 2:29 AM UTC

Well i think that first element blue, second green and third red will be a nightmare =)

Translate
Level 4
Oct 16, 2015 2:29 AM UTC

Well =) , richtext has nothing to do to my problem and you can ignore the word style. I have a selection component with 3 entries. For example i need to color the first entry to red. It's only this my problem.

Translate
edubey
edubeyAccepted solution
Level 10
Oct 16, 2015 2:29 AM UTC

yes, you can use 'cls' property, but the it won't add styles on drop down. This class will be added to the parent div of it. So you need to target that particular drop down div.

Translate
Lokesh_Shivalingaiah
Level 10
Oct 16, 2015 2:29 AM UTC

Can you provide the usecase in detail or the steps you want to do so that we can address this better.

Translate
edubey
Level 10
Oct 16, 2015 2:29 AM UTC

I understand the behavior od Styles drop down in RTE,

Now when you say, "you want to replicate this behaviour" what do you exactly mean. Are you planning to add one more drop down in richtext like styles?

Translate
Level 4
Oct 16, 2015 2:29 AM UTC

Doesn't exist the possibility to add the style as property?

Translate
Level 4
Oct 16, 2015 2:29 AM UTC

Hi, thanks for the replies

it's just coincidence that under the selection there is a richtext. The style selection isn't the style plugin of richtext, it's a simple selection component.

I want to replicate the same approach of the style plugin of richtext with another selection component.

Translate
Lokesh_Shivalingaiah
Level 10
Oct 16, 2015 2:29 AM UTC

It should work, you can highlight the text you want and select the style so that it applies the style only for the selected content.

Translate