drupal8_examples
drupal8_examples copied to clipboard
Examples / practice Drupal 8 modules and themes
Custom Drupal 8 Entities w/ Bundle Examples
- Most Simple - The Most Simple entity with bundles possible. Easy to create (very little code), hard to use (no links).
- Simple - Simple Entity with bundles that is much more usable than the Most Simple Entity. Has links, useful ListBuilders, and informative messages.
- Practical - More practical entity with bundles, generated bundle permissions, custom access control, entity fields, bundle descriptions, and much better ListBuilders with useful information. Also has interfaces for the Entity classes as best practice.
Learning about Drupal 8 Events
-
Module
- Registering services - Registering services
- Config CRUD Event Subscriber - Example event subscriber that listens for Config object events.
-
Custom Event - UserLoginEvent - Custom Event that will be dispatched on
hook_user_login()
. -
Custom Event - Dispatching Events - Dispatching an event during
hook_user_login()
. - Custom Event - Subscribing to Custom Event - Event Subscriber that listens for our custom UserLoginEvent.
Services & Dependency Injection
- Dependency Injection Examples
- Services Examples
- Calculator - More examples of services and dependency injection.
The most bare-minimum possible Drupal 8 module
- Module
The most bare-minimum possible Drupal 8 theme
- Theme - This can be enabled from the modules folder.
Cat API custom modules
These modules integrate with various free cat related APIs available online.
- Cat Facts
-
Cat API
- Services
- Blocks
- Dependency Injection