getThemeAssetsPath Helper for Theme Customization in NetSuite

The getThemeAssetsPath helper retrieves asset paths for theme customizations in NetSuite, streamlining Sass integration.

·1 min read·View Oracle Docs

The getThemeAssetsPath($asset) function serves as a Sass helper that simplifies the process of accessing both new and pre-existing assets within your theme directory. This function is particularly useful within extension overrides and theme customizations.

How to Use getThemeAssetsPath

To utilize this helper in your Sass files, you can apply it like so:

html
body {
background-image: url(getThemeAssetsPath('font-awesome'));
}

Result Explanation

When you invoke this helper, it returns the asset path that corresponds to the active theme. The resulting path will look something like this:

html
<FULL_PATH>/extensions/<VENDOR>/<THEME_NAME>/<VERSION>/font-awesome

This structure contains dynamic components that will adjust based on the specific vendor, the theme's name, and its version, ensuring your assets are always correctly linked and ready for use.

Who This Affects

  • Developers: When customizing themes and extensions in SuiteCommerce.
  • Theme Designers: For incorporating asset files smoothly into the design process.

Key Takeaways

  • The getThemeAssetsPath function provides a straightforward method to access theme directories.
  • It's essential for linking assets in Sass in NetSuite customizations.
  • Use it to ensure consistent paths across different themes and versions.

Source: This article is based on Oracle's official NetSuite documentation.

Frequently Asked Questions (4)

Is the getThemeAssetsPath function available for both theme and extension customizations in NetSuite?
Yes, the getThemeAssetsPath function can be used for both theme customizations and extension overrides in SuiteCommerce.
Do I need to enable any features to use the getThemeAssetsPath helper?
The article does not specify any feature flags or settings that need to be enabled; it implies the helper is ready for use as part of Sass in theme customizations.
How does getThemeAssetsPath handle dynamic elements like vendor, theme name, and version?
The getThemeAssetsPath function dynamically adjusts the asset path components to reflect the current vendor, theme name, and version in the directory structure.
Can getThemeAssetsPath be used in non-Sass files within NetSuite?
The article specifies the use of getThemeAssetsPath within Sass files, so the use case for non-Sass files is not addressed.
Source: getThemeAssetsPath($asset) 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 SuiteCloud Development Framework

View all SuiteCloud Development Framework articles →