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 Summary
FieldsModifier and TypeFieldDescriptionprotected AdvancedCmsWidgetTemplateResolverstatic final Stringprotected org.broadleafcommerce.cms.web.deeplink.ContentDeepLinkServiceImplprotected ContentItemServiceprotected ContentTargeterServiceprotected ContentZoneServiceprotected org.broadleafcommerce.cms.web.processor.ContentProcessorExtensionManagerprotected org.broadleafcommerce.cms.file.service.StaticAssetServiceprotected WidgetServiceFields inherited from interface org.broadleafcommerce.presentation.dialect.BroadleafProcessor
DEFAULT_PRECEDENCE, DEFAULT_PREFIX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddAnyProductsToModel(org.broadleafcommerce.presentation.model.BroadleafTemplateContext context, ContentItemDTO ciDto) 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 textgetName()intorg.broadleafcommerce.presentation.model.BroadleafTemplateModelgetReplacementModel(String tagName, Map<String, String> tagAttributes, org.broadleafcommerce.presentation.model.BroadleafTemplateContext context) booleanisSecure(jakarta.servlet.http.HttpServletRequest request) booleanprotected voidsetAssetAltTextMap(org.broadleafcommerce.presentation.model.BroadleafTemplateContext context, ContentItemDTO ciDto, org.broadleafcommerce.presentation.model.BroadleafTemplateNonVoidElement czElement) Methods inherited from class org.broadleafcommerce.presentation.dialect.AbstractBroadleafTagReplacementProcessor
getPrefix
-
Field Details
-
BLC_RULE_MAP_PARAM
- See Also:
-
staticAssetService
protected org.broadleafcommerce.cms.file.service.StaticAssetService staticAssetService -
contentZoneService
-
contentItemService
-
widgetService
-
extensionManager
protected org.broadleafcommerce.cms.web.processor.ContentProcessorExtensionManager extensionManager -
contentDeepLinkService
protected org.broadleafcommerce.cms.web.deeplink.ContentDeepLinkServiceImpl contentDeepLinkService -
contentTargeterService
-
advancedCmsWidgetTemplateResolver
-
-
Constructor Details
-
ContentZoneProcessor
public ContentZoneProcessor()
-
-
Method Details
-
getName
-
getPrecedence
public int getPrecedence()- Specified by:
getPrecedencein interfaceorg.broadleafcommerce.presentation.dialect.BroadleafProcessor- Overrides:
getPrecedencein classorg.broadleafcommerce.presentation.dialect.AbstractBroadleafTagReplacementProcessor
-
getReplacementModel
-
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:
replacementNeedsProcessingin interfaceorg.broadleafcommerce.presentation.dialect.BroadleafTagReplacementProcessor- Overrides:
replacementNeedsProcessingin classorg.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:
-