Skip to content

Commit 147a95a

Browse files
committed
Document fieldtype keywords
Closes #1534.
1 parent 331b15b commit 147a95a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

content/collections/extending-docs/fieldtypes.md

+16
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,22 @@ You can select from any of the keys available in the `FieldtypeSelector`:
171171
- `structured`
172172
- `special`
173173

174+
175+
## Fieldtype Keywords
176+
177+
You may specify keywords to be used when searching in the fieldtype selector.
178+
179+
For example: if you search for "rich text" or "gutenberg", the [Bard fieldtype](/fieldtypes/bard) will be returned as a result.
180+
181+
```php
182+
<?php
183+
184+
class CustomFieldtype extends Fieldtype
185+
{
186+
protected $keywords = ['file', 'files', 'image', 'images', 'video', 'videos', 'audio', 'upload'];
187+
}
188+
```
189+
174190
## Configuration Fields
175191

176192
You can make your fieldtype configurable with configuration fields. These fields are defined by adding a `configFieldItems()` method on your PHP class that returns an array of fields.

0 commit comments

Comments
 (0)