drupal-fields
Skill71 starsChanged 7 months agoMITView on GitHub
Drupal fields — field types, widgets, formatters, drush field:create, field storage/config, and accessing single-value and multi-value field values in PHP code.
In this repository35 other files it gives its agents.
- ddev-expertSkill
- docker-localSkill
- drupal-accessSkill
- drupal-cachingSkill
- drupal-composerSkill
- drupal-configSkill
- drupal-contrib-mgmtSkill
- drupal-debuggingSkill
- drupal-drushSkill
- drupal-dttSkill
- drupal-entity-apiSkill
- drupal-eventsSkill
- drupal-form-ajaxSkill
- drupal-form-alterSkill
- drupal-form-apiSkill
- drupal-form-validationSkill
- drupal-hooksSkill
- drupal-htmxSkill
- drupal-javascriptSkill
- drupal-kernelSkill
- drupal-menusSkill
- drupal-migrationsSkill
- drupal-paragraphsSkill
- drupal-pluginsSkill
- drupal-queriesSkill
- drupal-renderSkill
- drupal-routesSkill
- drupal-search-apiSkill
- drupal-securitySkill
- drupal-servicesSkill
- drupal-stateSkill
- drupal-taxonomySkill
- drupal-twigSkill
- drupal-unitSkill
- SKILL.mdSkill
The file
Files
Drupal Fields
Creating Fields (Drush — CLI First)
Always use drush field:create instead of manually creating field config files.
# Interactive (recommended first time)
drush field:create
# Non-interactive
drush field:create node article \
--field-name=field_subtitle \
--field-label="Subtitle" \
--field-type=string \
--field-widget=string_textfield \
--is-required=0 \
--cardinality=1
# Reference field
drush field:create node article \
--field-name=field_tags \
--field-label="Tags" \
--field-type=entity_reference \
--field-widget=entity_reference_autocomplete \
--cardinality=-1 \
--target-type=taxonomy_term
# Image field
drush field:create node article \
--field-name=field_image \
--field-label="Image" \
--field-type=image \
--field-widget=image_image \
--is-required=0 \
--cardinality=1Managing Fields
# List all fields on a content type
drush field:info node article
# Delete a field
drush field:delete node.article.field_subtitle
# Discover available types/widgets/formatters
drush field:types
drush field:widgets
drush field:formattersExport After Creating Fields
# Always export config after CLI changes
drush config:export -yCustom Field Type (Plugin)
drush generate plugin:field:type
drush generate plugin:field:formatter
drush generate plugin:field:widgetAccessing Field Values in Code
// Single value
$value = $entity->get('field_name')->value;
// Entity reference
$referenced = $entity->get('field_ref')->entity;
// Multi-value
foreach ($entity->get('field_multi') as $item) {
$value = $item->value;
}Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

