Create Custom Content Types Module for SuiteCommerce

Creating a custom module for CCTs allows dynamic content management in SuiteCommerce, enhancing website functionality and user experience.

·2 min read·View Oracle Docs

Creating a custom module for your Custom Content Type (CCT) in SuiteCommerce (SCA) allows you to manage dynamic functionality on your website. This article outlines the necessary components and steps to set up your CCT, which will provide features such as retrieving and updating data from NetSuite records, thereby enhancing the website's user experience.

What Files Are Required for a CCT Module?

Your CCT module must include the following files at a minimum:

  • Entry Point: This JavaScript or TypeScript file includes the mountToApp() method, linking your custom module to a CMS content type record. This makes it available for inclusion in your website.
  • View: This JavaScript file listens for events, interprets them, and defines variables for use in the template. These variables correspond to fields within your CMS content type record.
  • HTML Template: This file utilizes Handlebars.js helpers alongside HTML to render content on your site.

For example, when developing a fictitious CCT named SC.CCT.ImageViewer, this module introduces a simple image viewer that can pull data from either a custom record or from existing data in the browser context.

Steps to Create a CCT Module

Follow the steps below to create your custom CCT module:

  1. Create Your Custom Module: This should contain all your CCT files. Use the format for naming your CCT Module: SC.CCT.cctName@x.y.z, where cctName refers to your CCT and x.y.z denotes the version number. For example, SC.CCT.ImageViewer@0.0.1.

  2. Create Necessary Subdirectories:

    • JavaScript: Store your entry point JavaScript or TypeScript file and all views in this subdirectory.
    • Templates: This directory will hold the HTML template for your CCT.

Note: If your CCT includes new Sass, SuiteScript, or configuration files, ensure to also store these in their respective subdirectories.

Related Resources

To further enhance your understanding and implementation of CCTs, consider reviewing these related topics:

This guide serves as a starter framework for integrating CCTs into SCA, helping you leverage powerful custom features dynamically managed through the Site Management Tools (SMT).

Frequently Asked Questions (4)

Does creating a Custom Content Type (CCT) for SuiteCommerce require specific subdirectories?
Yes, when creating a CCT module, you must create subdirectories such as JavaScript for your entry point and view files, and Templates for your HTML templates.
What is the purpose of the entry point file in a CCT module?
The entry point file, which can be written in JavaScript or TypeScript, includes the mountToApp() method that links your custom module to a CMS content type record, making it available for your website.
Can a CCT module include additional types of files beyond JavaScript and HTML?
Yes, if your CCT includes new Sass, SuiteScript, or configuration files, they should be stored in their respective subdirectories within the module.
What naming convention should be used for Custom Content Type module versions in SuiteCommerce?
The CCT module should be named using the format SC.CCT.cctName@x.y.z, where cctName is your specific content type's name and x.y.z refers to the version number, for example, SC.CCT.ImageViewer@0.0.1.
Source: Create a Custom Module for Your CCT Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?

More in Commerce

View all Commerce articles →