0

I have created custom landing page in Lists -> Web Site -> CMS Pages and I want to add custom JS and CSS to that page, what are the steps to do it?

eXtreme
  • 244
  • 3
  • 18

1 Answers1

0

There are several ways. Probably the easiest way is to use the Site Management Tools from the front end. You can insert <script></script> and <style></style> tags into the HTML content areas.

Method 1:

  • Step 1: View your SCA website.
  • Step 2: Hit the ESC key.
  • Step 3: Navigate to Landing Pages>your landing page
  • Step 4: Click the pencil icon in the top navigation to begin editing
  • Step 5: Click the Plus icon in the top navigation to add a content area
  • Step 6: Click the HTML Content box in the right navigation
  • Step 7: Add your code in the HTML Content box. Put all JS within <script></script> tags and all CSS within <style></style> tags

Method 2:

  • A more stable method would be to create a custom module in the SuiteCommerce Advanced SSP Application, but that requires significantly more understanding of the code structure. I'm not going to describe it here because it would take all day. See this article: https://developers.suitecommerce.com/section4184021456

Method 3:

  • If you are using SMT v3 you can also edit the HTML Content areas from the custom record "CMS_HTML" in the NetSuite backend. It's a pain to set them up new there though, so I suggest adding the content area in the Site Management Tools first, then going into the custom record to edit, if you want to edit from the NetSuite backend.
The Windhover
  • 312
  • 3
  • 16
  • I tried the first approach, although the script codes are loaded in the Netsuite website, the scripts are not bee executed, so I am not having any effect, do yothink is there something I should enable to NS to identify a run the scripts added this way ? – WhGandalf Oct 02 '19 at 19:27
  • When you view your page in the browser and inspect via developer tools, do you see the in the HTML? If so, then the script should be running. If it's not running I'd guess that there's an error in the JS. Try running a simple console.log('test'); – The Windhover Oct 03 '19 at 20:31