Brightspot CMS User Guide

Back end


The Style Package module adds a stylePackage field to Theme in a modification. This can be accessed in the view model like so:

return Optional.ofNullable(WebRequest.getCurrent().as(ThemeRequest.class).getCurrentTheme())
        .map(theme -> theme.as(StyleThemeModification.class).getStylePackageOrDefault())
        .map(stylePackage -> createViews(viewClass, stylePackage))
        .orElse(null);

See the vm-style-package module for the implementation of StylePackageViewModel. The key line is:

StylePackageUrls urls = model.resolveForCurrentRequest();

This line returns absolute URLs suitable for rendering on the front end. It is not necessary to pass these URLS to the {{cdn}} helper.

Previous Topic
Front end
Next Topic
Create a built-in style package
Was this topic helpful?
Thanks for your feedback.
The elements that get you up and running in a matter of days, from pre-built content types, to modules, to landing pages.

Content types
Modules
Landing pages
Everything you need to manage and administer content within Brightspot CMS, including plug-and-play integrations.

Dashboards
Authoring content
Workflows
Admin configurations
A guide for installing, supporting and administering code on the Brightspot platform, including integrations requiring developer support to use.

Field types
Content modeling
Rich-text elements
Images