cq:styleDefaultClasses - classes are applied to components only on author | Community
Skip to main content
Level 2
July 15, 2022
Solved

cq:styleDefaultClasses - classes are applied to components only on author

  • July 15, 2022
  • 2 replies
  • 2314 views

I added a css class through the style system in a component.

The problem is that it only works in author mode, in publish mode it never works.

 

Has anyone faced this issue?

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 Aditya_Chabuku

Hi @joeltsousa1, If Replication is not working properly even after checking everything is working fine, Try to go with package your policies & update them on Publisher to firefight the problem.

After that, try to include these changes in the Codebase, change the filter to "update" and build & deploy.

 

2 replies

Sachin_Arora_
Community Advisor
Community Advisor
July 15, 2022

Please check the following :

 

  • Check if policy is getting activated as well to the publisher as default class is stored in policies for example : /conf/we-retail/settings/wcm/policies/weretail/components/content/carousel/policy_1550587632390 has few design level properties.
  • Check the default class is getting applied on component by inspecting it in browser. Default class should be on div of the component which has classes related to aem grid as well.
  • Check CSS is present in publisher as well.
Level 2
July 15, 2022

I'm trying to add this css class to the core component "Layout container"

And in author mode the class appears in the DOM

The css class has been added to the project's global css file

In dev and stage environments it is working correctly

 

Jagadeesh_Prakash
Community Advisor
Community Advisor
July 15, 2022

@joeltsousa1 : Try publishing the /conf/<project>/settings/wcm/policies/<project>/components through replication queue or distribution queue. It should work

Aditya_Chabuku
Community Advisor
Community Advisor
July 15, 2022

Hi @joeltsousa1, Try publishing the Template as shown below. If you still see this issue even though your Replication stack is clear, then try to package them & install them in the publisher as the last option.

Thanks,Aditya Chabuku
Level 2
July 18, 2022

my policy was replicated and it still doesn't work.

my policy path is as follows: /conf/my-prject/settings/wcm/policies/wcm/foundation/components/responsivegrid/policy_7061548212825753

will this be the problem?

Aditya_Chabuku
Community Advisor
Aditya_ChabukuCommunity AdvisorAccepted solution
Community Advisor
July 18, 2022

Hi @joeltsousa1, If Replication is not working properly even after checking everything is working fine, Try to go with package your policies & update them on Publisher to firefight the problem.

After that, try to include these changes in the Codebase, change the filter to "update" and build & deploy.

 

Thanks,Aditya Chabuku