Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Clientlibrary Folder with images/fonts folder under apps, 404 on publish

Avatar

Level 10

The issue is on publish environment

I have managed to create a client library folder under apps for a component,  and have created a client library folder under etc and embedded the one under apps. In the jsp, i have used cq:includeClientlibrary tag to include the category under etc.

The js and css are being picked up on Publish, but now the images/fonts folders under the clientlibrary folder under apps is not being picked up.

Any help?

1 Accepted Solution

Avatar

Correct answer by
Level 10

NitroHazeDev wrote...

Sham HC wrote...

How are you referring the images?  Is url wrongly written for images?

Check AEM version & list of hotfix installed b/n author & publish.    If 5.5 there was hotfix.

 

For now i have moved the clientlibs under etc, instead of using embed, which i was more keen on using.

Images are referenced from within the css/js files, ( ../images/image1.png), when i analyze though with embed approach js and css throws no errors, images still appear to be picked up from apps/ folder structure.

Thus, using embed, the images or fonts under the apps folder were being referenced (path ../../apps/../../image1.png), but the apps folder is locked down on publish. Hence it is not accessible. Though using embed, css and js issues were resolved, issue i was left with was the fonts,images folder under apps/proj/component/testcomponent/clientlibs, 

Is there something more with embed,  or is it a bug that only js and css files can be embedded and not the images or fonts folder within the clientlibrary folder?

 


There is no bug. In CQ5.4 and earlier urls in embedded css files are rewritten relative to the clientlib folder's location. In CQ5.5 onwards this mechanism has been changed and relative paths specified in embedded css files are resolved against the individual css file's location.

View solution in original post

7 Replies

Avatar

Level 10

How are you referring the images?  Is url wrongly written for images?

Check AEM version & list of hotfix installed b/n author & publish.    If 5.5 there was hotfix.

Avatar

Level 10

Sham HC wrote...

How are you referring the images?  Is url wrongly written for images?

Check AEM version & list of hotfix installed b/n author & publish.    If 5.5 there was hotfix.

 

For now i have moved the clientlibs under etc, instead of using embed, which i was more keen on using.

Images are referenced from within the css/js files, ( ../images/image1.png), when i analyze though with embed approach js and css throws no errors, images still appear to be picked up from apps/ folder structure.

Thus, using embed, the images or fonts under the apps folder were being referenced (path ../../apps/../../image1.png), but the apps folder is locked down on publish. Hence it is not accessible. Though using embed, css and js issues were resolved, issue i was left with was the fonts,images folder under apps/proj/component/testcomponent/clientlibs, 

Is there something more with embed,  or is it a bug that only js and css files can be embedded and not the images or fonts folder within the clientlibrary folder?

Avatar

Employee

/apps is never opened on publish.

I would move the images/fonts to /etc somewhere.

Avatar

Correct answer by
Level 10

NitroHazeDev wrote...

Sham HC wrote...

How are you referring the images?  Is url wrongly written for images?

Check AEM version & list of hotfix installed b/n author & publish.    If 5.5 there was hotfix.

 

For now i have moved the clientlibs under etc, instead of using embed, which i was more keen on using.

Images are referenced from within the css/js files, ( ../images/image1.png), when i analyze though with embed approach js and css throws no errors, images still appear to be picked up from apps/ folder structure.

Thus, using embed, the images or fonts under the apps folder were being referenced (path ../../apps/../../image1.png), but the apps folder is locked down on publish. Hence it is not accessible. Though using embed, css and js issues were resolved, issue i was left with was the fonts,images folder under apps/proj/component/testcomponent/clientlibs, 

Is there something more with embed,  or is it a bug that only js and css files can be embedded and not the images or fonts folder within the clientlibrary folder?

 


There is no bug. In CQ5.4 and earlier urls in embedded css files are rewritten relative to the clientlib folder's location. In CQ5.5 onwards this mechanism has been changed and relative paths specified in embedded css files are resolved against the individual css file's location.

Avatar

Level 10

Feike Visser wrote...

/apps is never opened on publish.

I would move the images/fonts to /etc somewhere.

 

I agree hence moved it, but hoped embed would fix the issue with images/fonts , while it fixed the css,js issue.

Avatar

Level 10

Sham HC wrote...

NitroHazeDev wrote...

Sham HC wrote...

How are you referring the images?  Is url wrongly written for images?

Check AEM version & list of hotfix installed b/n author & publish.    If 5.5 there was hotfix.

 

For now i have moved the clientlibs under etc, instead of using embed, which i was more keen on using.

Images are referenced from within the css/js files, ( ../images/image1.png), when i analyze though with embed approach js and css throws no errors, images still appear to be picked up from apps/ folder structure.

Thus, using embed, the images or fonts under the apps folder were being referenced (path ../../apps/../../image1.png), but the apps folder is locked down on publish. Hence it is not accessible. Though using embed, css and js issues were resolved, issue i was left with was the fonts,images folder under apps/proj/component/testcomponent/clientlibs, 

Is there something more with embed,  or is it a bug that only js and css files can be embedded and not the images or fonts folder within the clientlibrary folder?

 


There is no bug. In CQ5.4 and earlier urls in embedded css files are rewritten relative to the clientlib folder's location. In CQ5.5 onwards this mechanism has been changed and relative paths specified in embedded css files are resolved against the individual css file's location.

 

Ok so clearly using embed, the images do not get resolved, but the css and js files do, which forced me to go ahead with placing the entire client libs under etc, as Feike mentioned