Broadleaf Microservices
  • v1.0.0-latest-prod

Content Services

This guide covers how we make use of the ContentServices API.

Table of Contents

Theme Fields

Theme Fields within the Broadleaf Content Services allow for admin users to control the look and feel of the storefront without needing to modify the storefront code. When named and configured correctly, the storefront can be coded to handle theme fields in various ways.

For example, this starter makes use of these fields in the ThemeColors component. The ThemeColors component is a simple component that sets CSS variables based on a predefined naming scheme.

Content Items

Content Items are the core of the Broadleaf Content Services. They are the building blocks of the storefront can be managed through the Broadleaf admin and various APIs. This starter handles Content Items in two key ways:

  1. The ContentItemRenderer component is used to render the content item by its name (see pages/index.tsx).

  2. The CmsPageRenderer component is used to render a full page content item by its url (see `pages/[…​url].tsx).

In both cases, the actual content is rendered through several example "template" and "widget" compontents. See /cms/components for how these are used.