cancel
Showing results for 
Search instead for 
Did you mean: 

How to add script tags in cms components?

Former Member
0 Kudos

Is it possible to use JavaScript in a Paragraph Component on a page Content Slot? When the page is synced online, viewing the source reveals that the "script" tags have been removed.

Importing this content via ImpEx causes the same results.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

XSS filter removes all "script" tags from all forms (including hac impex import). HMC WYSIWYG editor (and its HTML source preview) replaces "script" tags with comments. So it is not a good pleace to review content with scripts. So in order to upload scripts to CMS there are 3 ways:

  • prepare impex file and load whole file using hac (do not copy and paste as XSS filter will remove script tags!)

  • prepare impex in source code and import it during hybris init / update

  • disable xss filter, xss.filter.enabled=false property (can be turned off in hac config ; load impex file; enable xss filter! (xss.filter.enabled=true)

0 Kudos

I am able to update script tags using the method Rafal has suggested. But this script is not getting rendered in browser. Any reason for that ?

Answers (2)

Answers (2)

Former Member
0 Kudos

am getting exception while loading through impex script in HAC and loading through file as well.

Thanks in advance. thirupathi

Former Member
0 Kudos

Hi, I'm facing the issue. I need to update a CMS paragraph component which includes javascript. However script tags are replaced by comments. I tried disabling the xss filter as mentioned in previous comment but no luck !

phoude
Participant
0 Kudos

did you find a solution?