Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

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

Avatar

Level 2

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.

 

joeltsousa1_0-1657882976326.png

Has anyone faced this issue?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

View solution in original post

8 Replies

Avatar

Community Advisor

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.

Avatar

Level 2

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

joeltsousa1_0-1657897180503.png

 

Avatar

Community Advisor

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

Avatar

Community Advisor

In that case please check the first point as I mentioned. Check in publisher CRXDE whether policy is getting updated after replication. If the policy is not getting updated on Publisher then check replication queue and access as well whether user has rights to publish policy.

Avatar

Level 2

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?

Avatar

Community Advisor

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

Avatar

Level 2

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?

Avatar

Correct answer by
Community Advisor

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