Extend the import pipeline
You can extend the import pipeline for the code-first workflow to customize various aspects of your application's data.
This procedure shows you how to extend the import process to allow customizing the path of templates you create.
To extend the import pipeline:
-
Extend your manifest data by adding your component to the JSS Manifest.
-
To make the custom path work, you must extend the import pipeline to alter how templates are created by the import process. Specifically, you must target the
ProcessTemplatesprocessor in theimportpipeline, derive from it, and alter its behavior. For example: -
You must now tell Sitecore to use the custom processor
ProcessTemplatesWithPathinstead of the defaultProcessTemplatesprocessor. Create a configuration patch, for exampleApp_Config/Include/PickAnyFileName.configand add the following configuration: -
Deploy your JSS app:
-
If this is the first time deploying the app, in a terminal, run the following command:
-
Otherwise, run the following command:
NoteWhen you run one of the scripts, JSS generates the manifest automatically in the file
sitecore/manifest/sitecore-import.json.The script outputs among other things, a message similar to the following:
-
-
In the Sitecore content tree, verify that the template was created at the path you requested.
NoteIf you previously deployed your JSS app and have an existing template item in the default location, remove it and change any usage of it to the new template.