Skip to main content
Level 2
May 5, 2022
Beantwortet

Javascript of a component not being applied

  • May 5, 2022
  • 3 Antworten
  • 2027 Ansichten

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 works

Dieses Thema wurde für Antworten geschlossen.
Beste Antwort von fedeperez

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

3 Antworten

Kiran_Vedantam
Community Advisor
Community Advisor
May 5, 2022

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/archetype/uifrontend.html?lang=en

 

Thanks,

Kiran Vedantam.

Shubham_borole
Community Advisor
Community Advisor
May 5, 2022

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

fedeperezAutorAntwort
Level 2
May 5, 2022

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