2.7 KiB
New England Drupal Camp @ Rhode Island College
Providence, RI
November 16, 2024
#NEDCamp2024
9am, Gaige Hall 201
When There's Not a Module for That: How to Make (and Maintain) a New Module
benjamin "mlncn" melançon
ben@agaric.coop
Agaric Technology Collective
presents
Note: my name's ben, i have been a worker and owner at the worker-owned Agaric cooperative since 2006.
When There's Not
a Module for That:
How to Make (and Maintain)
a New Drupal Module
Be a part of something bigger
(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
Example: BEF Links Filter
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
Note: If you decide your module should have one of those button links you see at the top right of a bunch of pages in Drupal's administration, you don't even need to know that they are called "Action Links" and find a tutorial on making them. You can just go look in the code of a module you know has them, grep for the label, and steal the code around it.
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.
To be continued…
Note: Let me know what you build!