Register Page Types and Templates for Site Management Tools

Learn to register new page types and templates in Site Management Tools, enhancing layout options for website pages.

·2 min read·View Oracle Docs

When site administrators create a new page in Site Management Tools (SMT), they define it as a specific page type. They can assign the Landing Page page type or any new page type registered through a SuiteCommerce extension.

As an extension developer, you utilize the Extensibility API to register new page types for this purpose. You can also register templates that serve as the default layout for your new page type or as alternative layout options for any existing page type. After installing and activating your extension, these new page types and templates become selectable during the page creation or enhancement process within SMT.

Example Use Case

For instance, if you create a new blog extension, you would:

  1. Register a new Blog page type with a default template.
  2. Register two additional templates that serve as alternative layouts for your blog page type.

Once your extension is activated, Blog will be available as a page type since administrators can either retain the default layout or select from the predefined alternatives when creating a new blog page.

Setting Up New Page Types and Templates

This tutorial outlines the essential steps for registering page types and templates in your extension:

  1. Create a View to Render a Registered Page Type: This section covers important aspects of any view required to render your new page type.

  2. Register a Page Type: Instructions on how to leverage the Extensibility API to register a page type and declare a default template are found here.

  3. Register a Template: This part guides you in accessing the Extensibility API to register a template, making it available as an alternative layout for the page types.

Best Practices for Views

When registering a page type using the PageType Component, it’s crucial to create a corresponding view:

  • Ensure the view handles requests for a registered page type and extends PageTypeBase.View.js.
  • Declare the view in the registerPageType() method while registering the associated type.
  • Control the rendering of the page type using the beforeShowContent() method.

Example View Setup

Here’s how to extend a view for a registered page type:

javascript
1"text-purple-400">define('MyPageType.View'
2, [
3 'PageType.Base.View'
4 , 'My_New_Default_Template.tpl'
5 ]
6, "text-purple-400">function (
7 PageType
8 , My_New_Default_Template_tpl
9 ) {
10 // Custom rendering logic
11 }
12);

This outlines how to incorporate your templates and manage dependencies effectively.

Conclusion

By following these steps and best practices, you can effectively register page types and templates in Site Management Tools, allowing for greater flexibility and customization of web pages within your NetSuite site. This process ultimately enhances the website’s content management capabilities, empowering site administrators to create diverse and tailored user experiences.

Frequently Asked Questions (4)

How can I register a new page type in Site Management Tools?
You can register new page types in Site Management Tools by using the Extensibility API within your SuiteCommerce extension. This involves defining the page type and associating it with a default template before making it accessible for site administrators to use.
What additional steps are needed after registering a page type to ensure it renders correctly?
After registering a page type, you must create a view that handles requests for the new page type. The view should extend `PageTypeBase.View.js` and include rendering logic declared in the `registerPageType()` method.
Can I register multiple templates for a single page type?
Yes, you can register multiple templates for a single page type. These templates can serve as default layouts or alternative layout options, providing flexibility in how pages of that type are displayed.
Is it necessary to activate the extension for new page types and templates to be selectable in Site Management Tools?
Yes, after registering new page types and templates, the extension must be installed and activated for them to become selectable during the page creation or enhancement process within Site Management Tools.
Source: Register Page Types and Templates for SMT 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 →