Aims: Create a selection filter for the slider projection. Lets say we only want 'feature' items appearing when we select them. We could go and fetch the ids and create a filter that way but having a check-box on the editor page for the content type is far more user friendly.
To achieve this we are going to need to do a bit of work. First we need a part and a record that can be used to define the sql query for the content items.
This part will be used to enable the item to be included in the query.
The Record is as simple:
The above part is attached to the content type which is being displayed in the Query. Time to create and define the filter for the query then...
Second part is a little more fiddly with dynamic forms but should be simple enough.
The two sections that we need to implement are:
The above function is used to define how the filter acts and looks:
Name and Description are how the filter are visibly shown in the group lists. Filter how Describe.For is the section where the item falls into.
filter: ApplyFilter - develop the query by saying how the value is used from the part. When the setting is needed and how to therefore query the data. The filter is creating two options:
display: DisplayFilter - Displays a user hint and describes how the filter is acting when once enabled.
form: "SliderItemFilter" - the dynamic form that the user uses to set the filter. The form is described through the implementation of IFormProvider. The provider creates a dynamic form, where its name matches the above string.