diff --git a/15/umbraco-cms/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/content-picker.md b/15/umbraco-cms/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/content-picker.md index 6de75e62af3..59f53d6e103 100644 --- a/15/umbraco-cms/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/content-picker.md +++ b/15/umbraco-cms/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/content-picker.md @@ -100,10 +100,12 @@ public class MyCustomDynamicRootQueryStep : IDynamicRootQueryStep _myCustomRepository = myCustomRepository; } + // The string below is what you specify in the UI to execute this custom query step. + public virtual string SupportedDirectionAlias { get; set; } = "MyCustomStep"; + public async Task>> ExecuteAsync(ICollection origins, DynamicRootQueryStep filter) { - // The string below is what you specify in the UI to execute this custom query step. - if (filter.Alias != "MyCustom") + if (filter.Alias != SupportedDirectionAlias) { return Attempt>.Fail(); } @@ -133,6 +135,32 @@ public class CustomQueryStepComposer : IComposer } ``` +Finally, register the custom query step on the client side and provide a brief description. + +You can do this in an `umbraco-package.json` file, as shown below: + +```json +{ + "$schema": "../../umbraco-package-schema.json", + "name": "My.Test.Extension", + "version": "0.1.0", + "extensions": [ + { + "type": "dynamicRootQueryStep", + "alias": "Umb.DynamicRootQueryStep.MyCustomStep", + "name": "Dynamic Root Query Step: My Custom Step", + "meta": { + "queryStepAlias": "MyCustomStep", + "label": "My Custom Step", + "description": "My custom step description.", + "icon": "icon-coffee" + }, + "weight": 0 + } + ] +} +``` + ### Allow items of type Choose which types of content should be available to pick using the Content Picker.