Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Custom Entity Example

Security covered Under active development 17 sites

This module helps developers create custom entities in Drupal quickly and easily. It provides both a user interface and Drush commands to generate a new entity, complete with administrative features, multilingual support, and view integration.

If asked about the quintessential element in Drupal, my immediate response would be the "Entity". It's the heartbeat of Drupal, its foundational concept.

Out of the box, Drupal offers essential entity types like node, taxonomy, user, block, comment, media, and more. Additionally, contribution modules expand the list with entities such as Commerce Product, Store, Order, Variation, Paragraph, and Component builder item.

However, despite their prevalence, coding a new Custom Entity often poses a challenge for many, whether they're beginners or experienced Drupal developers. The web overflows with guides on the topic, but successfully crafting a complete entity remains elusive for most.

Wouldn't it be wonderful if there was a function to craft a new entity effortlessly? This module now can help to generate a Drupal Custom Entity in just 3 minutes. The resulting entity adheres to standards, allowing any developer to extend its functionality.

Features

  • This module is a prototype of a standard custom entity that integrates seamlessly with admin content, type management, multilingual capabilities, and view contextual filters and so on.
  • This module provide a drush command for automated content generation using copy-replacement (detail in README.txt).
  • This module provide a user interface to automate new entity creation through copy-replacement (detail in README.txt).

How to use

There're 2 way to generate (clone) a new entity from this module

Approach 1: UI, visit website at the url:

  • admin/content/custom-entity-example-types/clone-form
  • make sure the folder location is writable
  • input your module in the destination fields
  • Click on Generate

Approach 2: Drush, you can use drush command line like some sample bellow:

drush cee-ge 'custom_entity_example' 'we_company' 'custom-entity-example' 'company' 'custom_entity_template_example' 'company' 'CustomEntityExample' 'WeCompany' 'custom entity example' 'company' 'Custom Entity Example' 'Company'

drush cee-ge 'custom_entity_example' 'we_contact' 'custom-entity-example' 'contact' 'custom_entity_template_example' 'contact' 'CustomEntityExample' 'WeContact' 'custom entity example' 'contact' 'Custom Entity Example' 'Contact'

drush cee-ge 'custom_entity_example' 'we_message' 'custom-entity-example' 'message' 'custom_entity_template_example' 'message' 'CustomEntityExample' 'WeMessage' 'custom entity example' 'message' 'Custom Entity Example' 'Message'

drush cee-ge 'custom_entity_example' 'we_follow' 'custom-entity-example' 'follow' 'custom_entity_template_example' 'follow' 'CustomEntityExample' 'WeFollow' 'custom entity example' 'follow' 'Custom Entity Example' 'Follow'

drush cee-ge 'custom_entity_example' 'we_connect' 'custom-entity-example' 'connect' 'custom_entity_template_example' 'connect' 'CustomEntityExample' 'WeConnect' 'custom entity example' 'connect' 'Custom Entity Example' 'Connect'

drush cee-ge 'custom_entity_example' 'we_connect_request' 'custom-entity-example' 'connect-request' 'custom_entity_template_example' 'connect_request' 'CustomEntityExample' 'WeConnectRequest' 'custom entity example' 'connect request' 'Custom Entity Example' 'Connect Request'

drush cee-ge 'custom_entity_example' 'we_contribution' 'custom-entity-example' 'contribution' 'custom_entity_template_example' 'contribution' 'CustomEntityExample' 'WeContribution' 'custom entity example' 'contribution' 'Custom Entity Example' 'Contribution'

drush cee-ge 'custom_entity_example' 'we_activity' 'custom-entity-example' 'activity' 'custom_entity_template_example' 'activity' 'CustomEntityExample' 'WeActivity' 'custom entity example' 'activity' 'Custom Entity Example' 'Activity'

drush cee-ge 'custom_entity_example' 'we_notification' 'custom-entity-example' 'notification' 'custom_entity_template_example' 'notification' 'CustomEntityExample' 'WeNotification' 'custom entity example' 'notification' 'Custom Entity Example' 'Notification'

drush cee-ge 'custom_entity_example' 'we_settings' 'custom-entity-example' 'settings' 'custom_entity_template_example' 'settings' 'CustomEntityExample' 'WeSettings' 'custom entity example' 'settings' 'Custom Entity Example' 'Settings'

drush cee-ge 'custom_entity_example' 'we_group' 'custom-entity-example' 'group' 'custom_entity_template_example' 'group' 'CustomEntityExample' 'WeGroup' 'custom entity example' 'group' 'Custom Entity Example' 'Group'


For both approaches, you will have your new module including the entity with essential functions to use for your projects.

  • You can see your manage entity content in /admin/content
  • You can see your manage entity structure in /admin/structure
Drupal 9–10 · not 11

Ask your assistant about Custom Entity Example

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Aug 2023
Latest release
3 years ago
Releases (12 mo)
0
Maintenance
Dormant

Release Timeline

Releases

Version Type Core PHP Release date
1.0.1 Stable 9–10 Nov 8, 2023
1.0.0 Stable 9–10 Sep 20, 2023
1.0.x-dev Dev 9–10 Aug 22, 2023