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
Â