Loading Clientlibs
Hi,
I have a setup where I am running three websites that use the same components, similar to this:
Sites:
/content/myproject/en-us/siteA/
/content/myproject/en-us/siteB/
/content/myproject/en-us/siteC/
Components:
/apps/myproject/
Design Files:
/etc/designs/siteA/
/etc/designs/siteB/
/etc/designs/siteC/
My "header.jsp" file calls the main clientlib that includes all CSS styling: <cq:includeClientLib categories="apps.myproject.main"/>
My problem now is that we would like to incorporate different CSS styles throughout Site C for global elements, such as button color, header graphic, etc, but everything wraps up to this main client library (apps.myproject.main).
I'm thinking that it would make sense to dynamically change out CSS styles like this:
<% String designID = currentDesign.getId(); %>
<cq:includeClientLib categories="apps.myproject.main"/> <-- this would include common JS/CSS
<cq:includeClientLib categories="apps.myproject.<%=designID%>.css"/> <-- this would include separate CSS for each site
Has anyone ran into a similar situation like this? Would this be the best approach? Any other recommendations?