Multiple granite:class | Community
Skip to main content
Level 6
July 9, 2021
Solved

Multiple granite:class

  • July 9, 2021
  • 1 reply
  • 1641 views

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.
Best answer by Dipti_Chauhan

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
Community Advisor
Dipti_ChauhanCommunity AdvisorAccepted solution
Community Advisor
July 9, 2021

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