Broadleaf Microservices
  • v1.0.0-latest-prod

Admin Components

Overview

The Content Services introduces several new metadata concepts to achieve a richer admin experience when dealing with content.

Content Fields

As Content Item’s are rendered in the admin based on its underlying ContentModel, the ContentFields metadata field type adds a convenient way to provide all the necessary information for the admin application to render its various dynamic fields. Because a model may define product, category and asset lookup fields, we need a way to tell the admin where to get this information.

The example below shows how we pass the various required configurations to the admin application.

Default Content Field form implementation
protected EntityFormView<?> configureContentFieldsForm(EntityFormView<?> entityFormView) {
    return entityFormView
            .order(2000)
            .label("content-item.forms.fields")
            .description("content-item.forms.fields.description")
            .addField(ContentProps.Item.FIELDS, new DefaultContentFields()
                    .productLookupConfig(ProductLookupHelpers.createProductIdLookup())
                    .categoryLookupConfig(CategoryLookupHelpers.createCategoryIdLookup())
                    .contentLookupConfig(
                            ContentItemLookupHelpers.createContentItemIdLookup())
                    .assetDropZoneConfig(EntityAssetHelpers.createAssetDropzoneField()));
}
Content Item’s Content Fields
Figure 1. Example screenshot of a content item and its fields

Theme Fields View

The ThemeField view is meant to provide users with an easy way to modify any theme related fields in the system. Fields are grouped and can be various different types. The ThemeFieldsView metadata view type collects all the necessary CRUD endpoints to handle field management. The screenshot below shows how the fields surface in the admin.

Theme Fields view
Figure 2. Screenshot of the Theme Fields admin view