Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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<Attempt<ICollection<Guid>>> ExecuteAsync(ICollection<Guid> 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<ICollection<Guid>>.Fail();
}
Expand Down Expand Up @@ -133,6 +135,32 @@ public class CustomQueryStepComposer : IComposer
}
```

Finally, you need to register the custom query step client side, and provide some further description.

This can be done in an `umbraco-package.json` file like the following:

```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": 60
}
]
}
```

### Allow items of type

Choose which types of content should be available to pick using the Content Picker.
Expand Down