HomeDev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunitySubmit a ticketLog In
GitHubNuGetDev CommunitySubmit a ticket

The Tasks pane contains predefined lists with queries like Drafts, Rejected or Recently Changed. You can also build your own query and plug it into the tasks list.

To add your own query, you need to implement `IContentQueryInterface` or inherit from one of the base classes that already have this interface (`ContentQueryBase`, `ContentActivitiesQueryBase`).

The query has to be registered in IOC container under `IContentQuery` type (using `ServiceConfiguration` attribute).

Then a few properties have to be implemented:

  • `Name` – unique name for the query

  • `DisplayName` – label displayed in drop-down list, used for grouping queries in the list

  • `SortOrder` – defines the position on the list

  • `VersionSpecific` - determines if query results should be treated as version specific when comparing links

  • PluginAreas – to make the query visible in the tasks list, we have to set PluginAreas to _EPiServer.Shell.ContentQuery.KnownContentQueryPlugInArea.EditorTasks_ string constant.

## Implement a custom query

In this example, we will create a query used to display all pages that were manually marked as being edited.

There is a repository registered under the `IInUseNotificationRepository` interface that returns all of its content. We use it in `GetContentMethod`.

After running the application, the query will be placed under "OTHERS" category.

To place it under one of existing categories, for example "STATUS", you need to add a generic type to `ContentQueryBase` or add a generic `IContentQuery` interface.

## Create custom query categories

It is also possible to create your own query category. `Category` is a class that implements the `IContentQueryCategory` interface and it is registered in IOC container under the `IContentQueryCategory` type (using `ServiceConfiguration` attribute).

The class has to implement two properties, `DisplayName`, which could be the name or key to a localization service, and `SortOrder` which is used when sorting categories in the list. Instead of using `TasksStatusQueryCategory`, use the `AlloyQueryCategory`.