Multiple granite:class

Avatar

Avatar
Applaud 25
Level 2
Shaheena_Sheikh
Level 2

Likes

2 likes

Total Posts

97 posts

Correct reply

1 solution
Top badges earned
Applaud 25
Applaud 5
Affirm 1
Validate 10
Validate 1
View profile

Avatar
Applaud 25
Level 2
Shaheena_Sheikh
Level 2

Likes

2 likes

Total Posts

97 posts

Correct reply

1 solution
Top badges earned
Applaud 25
Applaud 5
Affirm 1
Validate 10
Validate 1
View profile
Shaheena_Sheikh
Level 2

08-07-2021

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!

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 100
Level 6
Dipti_Chauhan
Level 6

Likes

126 likes

Total Posts

144 posts

Correct reply

41 solutions
Top badges earned
Boost 100
Give Back 10
Affirm 25
Boost 50
Boost 25
View profile

Avatar
Boost 100
Level 6
Dipti_Chauhan
Level 6

Likes

126 likes

Total Posts

144 posts

Correct reply

41 solutions
Top badges earned
Boost 100
Give Back 10
Affirm 25
Boost 50
Boost 25
View profile
Dipti_Chauhan
Level 6

08-07-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

Answers (0)