Adding Custom Javascript, CSS, and Head Content

Quite often you will need to add some custom Javascript and Head content into your online store. StoreConnect provides 3 different ways to insert data into your site on a per store basis within your Store record in salesforce under the CMS section.

Store CMS Section

Head Content Block

The Head Content field is a link to a CMS Content Block that contains anything you wish to insert into the <head>...</head> tag of your store. As this is inserted without any wrapping, be sure to select the “No Style Added” content block template when creating this.

Common uses for this are to add things like google analytics, or domain name validation meta tags.

The head content block is inserted into your store just before the closing </head> tag and before anything that is listed in the custom styles tag below.

Custom Styles

Custom styles are any small stylesheet tweaks you want to put on your store. Anything you put here will be inserted immediately before the closing </head> tag on your store after any Head Content Block. The content in this will also be inserted inside <style></style> tags so be sure to make this valid CSS. See Custom Theme CSS for more information.

Body Content Block

The Body Content field is a link to a CMS Content Block that contains anything you wish to insert at the end of the <body>...</body> of your store. You most likely want to use the “No Style Added” content block template when creating this so that it is not wrapped in any <div> tags or the like.

Common uses for the Body Content block are Live Chat scripts, or other custom javascript that needs to be loaded after the store page has been loaded.

 

 
Back to Documentation