Craft CMS provides a bunch of field types as part of the core application. Some of the field types are specialized to Craft CMS functionality, like the Assets field or the Matrix field, and others you can get on the Craft Plugin Store.
As I mentioned in the last video, Craft CMS provides a bunch of field types as part of the core application. Some of the field types are specialized to Craft CMS functionality, like the Assets field or the Matrix field.
But others, like Dropdown or Table fields, can be customized with your data.
While these are the field types provided by default with Craft CMS, you can also add your own custom field types to handle data situations specific to your site’s implementation. Mostly commonly, you’ll find these custom field types in plugins.
For example, on CraftQuest, I use the Videos plugin by Dukt. Videos is a plugin that makes it easy to include videos from third-party sources, like Vimeo or YouTube, and have programmatic access to the video data.
This plugin provides a custom field type called Videos, which exposes the plugin’s functionality as a field in your publish layout.
In the Craft Plugin Store, there’s an entire category on Fields. These range from the Redactor WYSIWYG field to the Recipe field for more easily formatting recipe data, and to something as simple as a single category select field. If you want to share a custom field with others that they can use on their projects, then you do it via a plugin.
However, you don’t have to have a plugin to create a custom field. Sometimes a project calls for a specific field that collects or retrieves data in a certain way.
In that case, you would use a module as the delivery mechanism for the field type. If you haven’t built a module before, check out my course My First Craft CMS Module, which will teach you the basics of building a module.
We’ll also build a simple module in this course to house our custom field types but I’ll link to the starter module to focus just on the field type and nothing else.
Okay, let’s get started!
I am the creator of CraftQuest, a web developer, and former software team manager. I spend most of my time improving CraftQuest with code and courses. When I'm not in front of the computer, I spend my time with my family, and running on the roads and trails of Austin, TX.