Using the Server-Side Include Tag
You can use the server-side Include tag in your item or category templates and in HTML pages hosted in your NetSuite file cabinet.
The server-side Include tag helps you reuse common HTML code across your site, like a page header, footer, or navigation menu. When it's time to update that code, you don't have to change every template and HTML file. Update the file used in the Include tag.
Using Include tags, instead of repeating blocks of HTML can help your website pages load faster. For more information, see Best Practices for Website Performance.
For example, if several pages on your site use the same HTML for a related items list template you customized, just upload a text or HTML file with the code to the right folder to your NetSuite file cabinet. Then use the Server-Side Include tag in the item drilldown template to pull in the HTML in the hosted file. When you need to update the HTML for your related items list, edit the hosted file.file.
Web Site tags are not supported in SuiteCommerce Advanced websites.
To use the Server-Side Include tag:
-
Create a text or HTML file for the code you call in other site pages.
-
Upload this file to the appropriate folder in your NetSuite File Cabinet.
-
Now, you are ready to create your Server-Side Include tag. This is the syntax:
<%=include('URL')%>
Replace
URL
with the site-relative URL of your HTML or text file. This must be a quoted string. This field is case sensitive. For example:<%=include('/list.html')%>
-
Place this tag in the hosted pages of your site, or in an item/category template where you want the common piece of HTML code to appear.
Currently, you cannot use Server-Side Include tags in site theme templates.