template level css change | Community
Skip to main content
New Participant
March 1, 2018
Solved

template level css change

  • March 1, 2018
  • 2 replies
  • 1557 views

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.

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 Ravi_Pampana

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!

2 replies

Ravi_Pampana
Ravi_PampanaAccepted solution
New Participant
March 1, 2018

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!

navinkaushal
New Participant
March 1, 2018

Use designs for your template. It would help Designs and the Designer