Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Javascript of a component not being applied

Avatar

Level 2

Hi, i'm struggling with this, i created a custom component called swcarousel and i'm trying to use a JS file with some functions that are used to change from image to image, the JS file is placed in the path

 

ui.frontend/src/main/webpack/components

 

but it still not working, someone has an idea how these JS files are used from there.

 

P.D Im need to do it from there and not from clientlibs for this component, and the SCSS file placed in the same path worksScreen Shot 2022-05-05 at 8.41.40 AM.png

1 Accepted Solution

Avatar

Correct answer by
Level 2

Thanks to everyone that tried to help, the problem is another one now.

View solution in original post

3 Replies

Avatar

Community Advisor

Hi @fedeperez 

 

A couple of questions here:

Are the clientlibs getting generated for the component?

Did you add the client-libs in the HTL for the component?

 

Check this for reference: https://experienceleague.adobe.com/docs/experience-manager-core-components/using/developing/archetyp...

 

Thanks,

Kiran Vedantam.

Avatar

Community Advisor

Hi @fedeperez 

Do you have a set up where your js and css under "ui.frontend/src/main/webpack/components" are created under "/apps/project/clientlibs/uife(custom folder)/clientlib-carouselcomp"

This is configured at 'clientlib.config.js' I think. See https://github.com/adobe/aem-guides-wknd/blob/main/ui.frontend/clientlib.config.js 

 

Just wanted to make sure this is working well. And if you have the clientlib generated under /apps then that clientlib category should be included in template that includes the carousel component (or the component html it self) for the desired css or js to  load.

 

Hope this helps.

 

Shubham

Avatar

Correct answer by
Level 2

Thanks to everyone that tried to help, the problem is another one now.