Skip to main content
Oct 16, 2015 2:26 AM UTC
Solved

css in custom component not published

Hi ,

I create a custom component "My button" with some clientlib css .

in author instance(http://localhost:4502/cf#/content/training-page-3.html) ,

it looks good:

[img]tt.png[/img]

[img]t.png[/img]

but when I publish the page (http://localhost:4503/content/training-page-3.html),

this component comes out without css :

[img]ttt.png[/img]

I'm quite new to cq5 ,can anyone help me ?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Sham_HC
Sham_HCAccepted solution
Level 10
Oct 16, 2015 2:26 AM UTC

You need to activate the client lib component also.  It is recommended to do using package & more details at http://docs.adobe.com/docs/en/cq/current/administering/package_manager.html or use tree activation.  

You can also refer http://www.wemblog.com/2013/01/how-to-publish-code-component-in-cq.html

Thanks,

Sham

Twitter: adobe_sham

8 replies

Oct 16, 2015 2:26 AM UTC

It works !! Thank you two very much ! yes

Translate
Lokesh_Shivalingaiah
Level 10
Oct 16, 2015 2:26 AM UTC

So it clearly shows that the css is not available on publish instance !

As Mr. Fieke mentioned, you can move the css for button under etc/designs/<project name>/clientlibs and publish the same.

Translate
Feike_Visser1
Adobe Employee
Adobe Employee
Oct 16, 2015 2:26 AM UTC

The issue you are facing is that on publish the "/apps" folder is closed and can't be reached by a non logged-in user.

It is better to move the clientlibs to /etc/clientlibs 

Translate
Oct 16, 2015 2:26 AM UTC

thank you for reply. here's some screenshot:

[img]button.png[/img]

------------------

[img]fire.png[/img]

-------------------

[img]fire2.png[/img]

perhaps it's not the clientlib issue but i'm not sure.

Translate
Lokesh_Shivalingaiah
Level 10
Oct 16, 2015 2:26 AM UTC

Hi Richard,

You might have to check couple of things here.

1. clientlibs which contains the css files for the button component is also published. You can verify by accessing the css file in publish instance directly or by using browser plugins.

2. In publish mode, some other css might be overriding this and you might have to check the same.

Best way to find it is to debug using browser developer tools and inspect the element to check the css applied on that component,

Translate
Oct 16, 2015 2:26 AM UTC

Thank you for reply. What do you mean by "activate the client lib component" I've already activated the whole project in the Activate Tree (http://localhost:4502/etc/replication/treeactivation.html)  and still not css

Translate
Sham_HC
Sham_HCAccepted solution
Level 10
Oct 16, 2015 2:26 AM UTC

You need to activate the client lib component also.  It is recommended to do using package & more details at http://docs.adobe.com/docs/en/cq/current/administering/package_manager.html or use tree activation.  

You can also refer http://www.wemblog.com/2013/01/how-to-publish-code-component-in-cq.html

Thanks,

Sham

Twitter: adobe_sham

Translate
smacdonald2008
Level 10
Oct 16, 2015 2:26 AM UTC

This means that  the CSS file is not in a proper clientlibs folder. Read this topic:

http://docs.adobe.com/docs/en/cq/current/developing/clientlibs.html

make sure that you place the CSS file in a proper clientlibs folder that is on pub. 

Translate