Class ContentZoneProcessor

java.lang.Object
org.broadleafcommerce.presentation.dialect.AbstractBroadleafTagReplacementProcessor
com.broadleafcommerce.advancedcms.processor.ContentZoneProcessor
All Implemented Interfaces:
org.broadleafcommerce.presentation.dialect.BroadleafProcessor, org.broadleafcommerce.presentation.dialect.BroadleafTagReplacementProcessor

@Component("blContentZoneProcessor") @ConditionalOnTemplating public class ContentZoneProcessor extends org.broadleafcommerce.presentation.dialect.AbstractBroadleafTagReplacementProcessor
A Thymeleaf processor that will render a ContentZone

Example: A Tag declared like: <blc:content-zone name="cz1" /> replaces itself with

<div th:replace="~{blc-widget-html/1}" />
the "substituteby" will resolve HTML for widget with id 1 and will pass in either a "sc" or "scs" variable to the widget, depending on whether or not it supports multiple SC it finds the content zone's default content item, and uses the widget associated there. Additional arguments can be passed to this processor by using: <blc:content-zone name="cz1" args-yourArg="1234" />

Content zones can also be added to pages. They can be invoked in the HTML by leveraging the "pageField" argument: <blc:content-zone pageField="${BLC_PAGE.pageFields[contentZone]}" />

Author:
apazzolini
  • Field Details

    • BLC_RULE_MAP_PARAM

      public static final String BLC_RULE_MAP_PARAM
      See Also:
    • staticAssetService

      protected org.broadleafcommerce.cms.file.service.StaticAssetService staticAssetService
    • contentZoneService

      protected ContentZoneService contentZoneService
    • contentItemService

      protected ContentItemService contentItemService
    • widgetService

      protected WidgetService widgetService
    • extensionManager

      protected org.broadleafcommerce.cms.web.processor.ContentProcessorExtensionManager extensionManager
    • contentDeepLinkService

      protected org.broadleafcommerce.cms.web.deeplink.ContentDeepLinkServiceImpl contentDeepLinkService
    • contentTargeterService

      protected ContentTargeterService contentTargeterService
    • advancedCmsWidgetTemplateResolver

      protected AdvancedCmsWidgetTemplateResolver advancedCmsWidgetTemplateResolver
  • Constructor Details

    • ContentZoneProcessor

      public ContentZoneProcessor()
  • Method Details

    • getName

      public String getName()
    • getPrecedence

      public int getPrecedence()
      Specified by:
      getPrecedence in interface org.broadleafcommerce.presentation.dialect.BroadleafProcessor
      Overrides:
      getPrecedence in class org.broadleafcommerce.presentation.dialect.AbstractBroadleafTagReplacementProcessor
    • getReplacementModel

      public org.broadleafcommerce.presentation.model.BroadleafTemplateModel getReplacementModel(String tagName, Map<String,String> tagAttributes, org.broadleafcommerce.presentation.model.BroadleafTemplateContext context)
    • addAnyProductsToModel

      protected void addAnyProductsToModel(org.broadleafcommerce.presentation.model.BroadleafTemplateContext context, ContentItemDTO ciDto)
    • setAssetAltTextMap

      protected void setAssetAltTextMap(org.broadleafcommerce.presentation.model.BroadleafTemplateContext context, ContentItemDTO ciDto, org.broadleafcommerce.presentation.model.BroadleafTemplateNonVoidElement czElement)
    • isSecure

      public boolean isSecure(jakarta.servlet.http.HttpServletRequest request)
    • replacementNeedsProcessing

      public boolean replacementNeedsProcessing()
      Specified by:
      replacementNeedsProcessing in interface org.broadleafcommerce.presentation.dialect.BroadleafTagReplacementProcessor
      Overrides:
      replacementNeedsProcessing in class org.broadleafcommerce.presentation.dialect.AbstractBroadleafTagReplacementProcessor
    • collectImagesAltText

      protected Map<String,String> collectImagesAltText(List<org.broadleafcommerce.common.structure.dto.StructuredContentDTO> structuredContentDTOs)
      Collect the image alt text from all the StructuredContents and return a map with the key as the full URL and the value as the alt text
      Parameters:
      structuredContentDTOs -
      Returns: