1

I created a custom rendering in SXA 1.4, I created a new JavaScript file for that component and I'm trying to added it to to be rendered in the public site.

How can I do that for the entire site or for a single page where the components is used?

3

This is part of the standard setup for SXA themes. Sitecore outlines theme creation here. Simply add the script to the theme found in the media library.

As for page specific, this question on SSE may give you the solution you need.

  • OK... so once I add/delete a script item under my theme's scripts folder, the optimized-min.js gets deleted and regenerated to include the latest updates. Cool. Thanks – TamerM Mar 25 '18 at 15:06
  • 1
    That is correct. If you add aodisabled=1 in your script, you can see the unbundled version; disabling the bundle feature can be done globally or on a site level as well. – Michael West Mar 25 '18 at 15:15
0

The SXA allow you to add your custom JS based on you theme.

You can create Multiple themes and different logics and different JS and can use them based on you needs. This allows to have more command over Multiples Sites based solution.

enter image description here

There is also a way for adding a page specific JS.

Thanks to @MichaelWest

https://sitecore.stackexchange.com/a/9404/2948

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.