Multiple granite:class | Community
Skip to main content
Level 6
Jul 9, 2021 6:31 AM UTC
Solved

Multiple granite:class

Hi All,

I added "granite:class" property to a text field in a component dialog. I made this field of type "String" and "Multiple". Added 2 class names to this fields, saved the changes and checked my page. I could only see the first class name. I wanted to know if "granite:class" is always a single value? And, how can I have more than 1 class added to it.

Thanks!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Dipti_Chauhan
Dipti_ChauhanAccepted solution
New Participant
Jul 9, 2021 6:48 AM UTC

Hi @shaheena_sheikh 

 There is no need to declare it as string array. You just need to mention your classes with spaces thats it.

 

e.g

granite:class="class1 class2 class3"

 

Thanks

Dipti

1 reply

Dipti_Chauhan
Dipti_ChauhanAccepted solution
New Participant
Jul 9, 2021 6:48 AM UTC

Hi @shaheena_sheikh 

 There is no need to declare it as string array. You just need to mention your classes with spaces thats it.

 

e.g

granite:class="class1 class2 class3"

 

Thanks

Dipti

Translate