Understanding how the SXA pipelines and their processors work provides you with an insight into how dependencies are rendered, how tokens for rendering variants are created, how CSS classes are generated, and so on.
A pipeline consists of a sequence of processors. A processor is a .NET class that implements a method. When a pipeline is invoked, the processors are run in order. You can extend and customize the pipelines by adding or replacing processors. Extending a pipeline involves modifying the pipeline definition located in a Sitecore patch file.
This topic describes the following pipelines:
resolveVariantTokens pipeline is used to create tokens for rendering variants.
Renders the span HTML element with the class according to the extension of the file.
Specifies the ID of the content item to be resolved.
Specifies the name of the content item to be resolved.
Renders the file size.
The Inversion of Control (IoC) design principle allows you to change rendering dependencies without changing the rendering itself. The
ioc pipeline is defined in the
Sitecore.XA.Foundation.IoC.config file and is used for adding processors in which you can register your custom services in the container.
RegisterPageContentServices processor to register services used in the Page Content feature.
<processor type="Sitecore.XA.Feature.PageContent.Pipelines.IoC.RegisterPageContentServices, Sitecore.XA.Feature.PageContent" />
decoratePage pipeline is used to decorate the page
<body> tag with attributes. These can be standard attributes, such as
class, but you can also add custom data attributes.
decorateRendering pipeline is used to decorate the rendering's outer <div> tag with attributes. These can be standard attributes, such as
class, but you can also add custom data attributes.
<div class="component title">
Title of the page
mediaRequestHandler pipeline is used in the SXA media requests handler. The
iaRequestHandler pipeline is defined in the
This file extends the standard media request handler by adding a pipeline that implements custom functionalities such as the support of wireframe images or providing optimized assets.
This pipeline includes the following processors:
Checks if the HTTP request is a valid media type. If not, the pipeline is aborted.
Determines the media item from the URL that is stored in HTTP request.
Redirects the user to an error page.
resolveTokens pipeline is used to resolve tokens that can be used in queries. For example:
$compatibleThemes- path to all themes
$theme- currently used theme
$pageDesigns- root of page designs
$partialDesigns- root of partial designs
$currenttemplate- name of the current template
$tenant- path to the current tenant
$site- path to the current site
$home- path to the current site start item (Home)
$templates- path to the current site templates
$siteMedia- path to Virtual Media folder located under site
By adding new processors to this pipeline, you can design new tokens.
This pipeline is defined in the
Sitecore.XA.Foundation.TokenResolution.config file and includes the following processors:
Determines the current tokens used.
Used to escape tokens that are used in Sitecore queries.
assetService pipeline is responsible for assets optimization. This pipeline includes the
AddEditingtheme processor, which you can use to add a theme when you are in Edit mode.
<processor type="Sitecore.XA.Foundation.Editing.Pipelines.AssetService.AddEditingTheme, Sitecore.XA.Foundation.Editing" />
getRobotsContent pipeline is used to extend the response provided to search crawler robots in the
robots.txt file. The
Robots.txt file is a simple text file on your site’s root directory that tells search engine robots what to crawl and what not to crawl on your site. The
getRobotsContent pipeline contains the following processors:
Checks if the robots' content field is filled and uses its value.
Adds the path of the
getRenderingCssClasses pipeline is used to gather CSS classes that will be applied on rendering (added to the list of CSS classes on rendering).
refreshHttpRoutes pipeline is used to refresh HTTP routes after changes in site configuration.
getVelocityTemplateRenderers pipeline is used to add a custom renderer that later on can be used in the NVelocity template. This pipeline is defined in the
Sitecore.XA.Foundation.RenderingVariants.config file. It contains the following processors:
Initializes the pipeline argument objects.
Provides two custom tools that format data and time values (dateTool) and numbers (numberTool) in an NVelocity template.
resolveSearchQueryTokens pipeline is used to add search filters. This pipeline is defined in the
Sitecore.XA.Foundation.Search.config file. By default, the following tokens are available:
resolveBoostingQuery pipeline is used to add extension point that can be used to write your own search boosting rules and then use them in SXA. To do that you can write your own custom rule and use the
resolveBoostingQuerypipeline to turn it into a query. This pipeline is defined in
Sitecore.XA.Foundation.Search.config file and includes the following processor:
<processor type="Sitecore.XA.Foundation.Search.Pipelines.ResolveBoostingQuery.ResolveFieldAndQueryMatchRule, Sitecore.XA.Foundation.Search" resolve="true" />