Configuring preview types
Brightspot provides two options for configuring the available preview types for a specific content type: programmatic and admin. This topic explores each option in detail.
Programmatic configuration
Programmatic configuration is useful when you want a particular content type to always use a specific preview type. To programmatically configure the preview types, you need to implement the PreviewTypeSupplier
interface on the relevant content type. Once implemented, you must provide an implementation for the getPreviewTypes
method, which takes the preview object as input and returns a list of all the supported preview types.
Assets implementing PreviewTypeSupplier
support only the preview types returned by the getPreviewTypes
method. However, keep in mind that the shouldDisplay
method of those preview types must still return true
for the given preview object in order for them to be displayed in the UI.
Admin configuration
Administrators can configure the available preview types for a specific site using the admin interface in Sites & Settings. To access this configuration, navigate to the > Admin > Sites & Settings > CMS Tab > Preview Cluster > Preview Types field. Here you can define the preview types that should be available. Any preview type whose shouldDisplay
method returns true
for a given preview object will be displayed as an available preview type in the UI, unless a content type implements PreviewTypeSupplier
as described in the previous section.
By utilizing these configuration options, you can customize the available preview types for your content types either programmatically or through the admin interface. This allows you to control how content is previewed, and ensures that the appropriate preview types are available for your specific needs.