Commit while tired

This commit is contained in:
benjamin melançon 2024-11-15 20:14:03 -05:00
parent d7ce9bc8c5
commit df412c0c1b

View file

@ -1,12 +1,12 @@
New England Drupal Camp @ Rhode Island College New England Drupal Camp @ Rhode Island College
Providence, RI Providence, RI
November 16, 2024 November 16, 2024
#NEDCamp2024 #NEDCamp2024
9am, Gaige Hall 201 9am, Gaige Hall 201
#### When There's Not a Module for That: How to Make (and Maintain) a New Module #### When There's Not a Module for That: How to Make (and Maintain) a New Module
benjamin "mlncn" melançon benjamin "mlncn" melançon
ben@agaric.coop ben@agaric.coop
--- ---
@ -21,40 +21,46 @@ Note: my name's ben, i have been a worker and owner at the worker-owned Agaric c
--- ---
## When There's Not a Module for That: ## When There's *Not*
### How to Make (and Maintain) a New Module ## a Module for That:
### How to Make (and Maintain)
### a New Drupal Module
--- ---
### Be a part of something bigger ### Be a part of something bigger
(but not as big as all of Drupal) (but not as big as all of Drupal)
#### Commerce
#### Extra Field
#### ECA
#### Search API (and friends)
Note: Build on or with some major —and with luck join a community of Note: Build on or with some major —and with luck join a community of
---- ----
#### Commerce ##### Example: BEF Links Filter
----
#### Extra Field
----
#### ECA
----
#### Search API
And friends including Facets and Better Exposed Filters
-----
##### BEF Links Filter
[drupal.org/project/bef_links_filter](https://www.drupal.org/project/bef_links_filter) [drupal.org/project/bef_links_filter](https://www.drupal.org/project/bef_links_filter)
Search API's friends include Facets and Better Exposed Filters
Note: By extending BEF Links module, we were able to get a lot of power— with a much better user experience, thanks to our ~250 lines of code altogether.
----
#### Look for plugin opportunities
Literally, look for plugins,
in `src/Plugin` of whatever modules you are operating in the vicinity of.
BEF Links Filter is a `better_exposed_filters` plugin in about 250 lines of code altogether.
Doing your own or copying
--- ---
### Steal, and keep stealing ### Steal, and keep stealing
@ -68,10 +74,22 @@ Note: If you decide your module should have one of those button links you see at
---- ----
![grep -nHIRs "Add content block" web/core/ with a half-dozen results, including web/core/modules/block_content/block_content.links.action.yml:9 and a bunch of results in tests.](images/add-content-block-action-link.png) ![grep -nHIRs "Add content block" web/core/ with a half-dozen results, including web/core/modules/block_content/block_content.links.action.yml:9 and a bunch of results in tests.](images/grep-add-content-block-action-link.png)
Note: Grep. Even when i am fully using an IDE for everything else, i grep in the regular command line when looking for text in a file. This habit is probably fueled more by failing to tell the IDE to index Drupal core and contrib modules more than anything else. Note: Grep. Even when i am fully using an IDE for everything else, i grep in the regular command line when looking for text in a file. This habit is probably fueled more by failing to tell the IDE to index Drupal core and contrib modules more than anything else.
----
!["block_content_add_action:
route_name: block_content.add_page
title: 'Add content block'
appears_on:
- block.admin_library
- entity.block_content.collection
class: \Drupal\block_content\Plugin\Menu\LocalAction\BlockContentAddLocalAction"](images/yml-add-content-block-action-link.png)
--- ---
To be continued… To be continued…
Note: Let me know what you build!