How to Extend Pipes
In order to create a new Pipe, you have to create a new class that implements:
IPipe<ICategoryIndexingCommand<T>>, where T : NodeContent
if you want to add a pipe for further processing of catalog categories.
IPipe<IEntryIndexingCommand<T>>, where T : EntryContentBase
if you want to add a pipe for further processing of catalog entries.
IPipe<IPageIndexingCommand<T>> where T : PageData
if you want to add a pipe for further processing of site pages.
You will have to implement 2 properties and a method
Order is a property which determines the priority of a pipe execution inside a pipeline.
Name is a property depicting the name of the pipe.
Execute is a method which holds the inner workings of the pipe. Generic parameter T is of type IPipeCommand. This is a base interface which the mentioned
ICategoryIndexingCommand
,IEntryIndexingCommand
andIPageIndexingCommand
inherit from.
Afterwards, you have to register your pipe in order for it to be picked up and executed. Use one of the built-in extension methods:
ExtendCategoryIndexing<>()
ExtendProductIndexing<>()
ExtendVariantIndexing<>()
ExtendBundleIndexing<>()
ExtendPackageIndexing<>()
ExtendPageIndexing<>()
Examples
New pipe for adding shipping information to a variant
Creation
Registration
New pipe for adding custom attributes to a certain page type (LocationItemPage from Foundation)
Creation
Registration
New pipe for indexing an entry’s images - a general example for all entries
Creation
Registration