Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

template level css change

kiranc13433869
Level 4
Level 4

is it possible to change css on basis of template selection.

all the components will be same.

but css should change like font colour, size, bg color etc.

i do not find any point of recreating components just because css changed. as backend execution even html classes id are same.

please help for understanding the process

or is there any work around for such situation.

1 Accepted Solution
Ravi_Pampana
Correct answer by
Community Advisor
Community Advisor

You can also try wrapping the parsys added in the template with some html tag (div/span etc) and add class to the tag.  Using the class the styles can be modified.

Ex:

Template --> Page Component --> JSP (Where template parsys is added)

<div class="templatename">

<cq:include path="par" resourceType="foundation/components/parsys" />

</div>

By adding this all the components will be wrapped under div having class (templatename) and styles can be added based on templatename.

Hope this helps!

View solution in original post

2 Replies
Ravi_Pampana
Correct answer by
Community Advisor
Community Advisor

You can also try wrapping the parsys added in the template with some html tag (div/span etc) and add class to the tag.  Using the class the styles can be modified.

Ex:

Template --> Page Component --> JSP (Where template parsys is added)

<div class="templatename">

<cq:include path="par" resourceType="foundation/components/parsys" />

</div>

By adding this all the components will be wrapped under div having class (templatename) and styles can be added based on templatename.

Hope this helps!

View solution in original post