OK now we have more about what we're going to say than we have of saying

This commit is contained in:
benjamin melançon 2020-03-18 23:17:55 -04:00
parent 6894236778
commit 5d32ee26aa

View file

@ -61,6 +61,20 @@ mid-air camp
{{% note %}} {{% note %}}
{{% /note %}} {{% /note %}}
---
What do you do
## When there's not a module for that
?
{{% note %}}
You make your own. It's easy.
{{% /note %}}
--- ---
@ -68,7 +82,9 @@ mid-air camp
{{% note %}} {{% note %}}
Say you're creating a site where people can relive great literature that may have been inspired by a global pandemic. Say you're creating a site where people can relive great literature that may have been inspired by a famine.
You've already created an excellent content type under Structure » Content.
{{% /note %}} {{% /note %}}
--- ---
@ -128,6 +144,11 @@ function frankenstein_form_node_frankenstein_form_alter(&$form, \Drupal\Core\For
![Regular node add form with Save button as reanimate](images/create-frankenstein-reanimate.png) ![Regular node add form with Save button as reanimate](images/create-frankenstein-reanimate.png)
{{% note %}}
Tadaaa! Now you know how to make a module!
{{% /note %}}
--- ---
![Adam Scott staring at the camera](images/adam-scott-conan-stare.gif) ![Adam Scott staring at the camera](images/adam-scott-conan-stare.gif)
@ -136,7 +157,15 @@ function frankenstein_form_node_frankenstein_form_alter(&$form, \Drupal\Core\For
So you're all sitting* there thinking ... sure, that's easy if you know the exact words and symbols to *put* in that file. And you're absolutely right. So you're all sitting* there thinking ... sure, that's easy if you know the exact words and symbols to *put* in that file. And you're absolutely right.
And we're going to tell you how you can figure out all of that. And we're going to tell you how you can figure out all of that.
{{% /note %}}
---
A few basic approaches give a lot of power.
<img alt="Screwdriver with extensive collection of driver tips." src="images/screwdriver-tip-set.jpg" width="70%" />
{{% note %}}
The examples with the what will tell you a lot about the how. The examples with the what will tell you a lot about the how.
A few specific examples will give you a lot of tools. A few specific examples will give you a lot of tools.
@ -175,12 +204,19 @@ You now know enough to be dangerous.
* There's a dozen variations of the humble form alter hook, and all are valid. * There's a dozen variations of the humble form alter hook, and all are valid.
{{% note %}} {{% note %}}
With our dirty secrets acknowledged, on with the show.
{{% /note %}} {{% /note %}}
--- ---
#### We'll cover 1. Act One: How Not To Make a Module
2. Act Two: How Not To Have to Make a Whole Module
3. Act Three: How To Make a Module
4. Act Four: How To Figure Out How To Make a Module
---
## We'll cover
* Hooks * Hooks
* Form alter * Form alter
@ -196,12 +232,6 @@ You now know enough to be dangerous.
the three main ways to mess with Drupal 8 and 9: hooks, plugins, and services, with a couple examples in each. the three main ways to mess with Drupal 8 and 9: hooks, plugins, and services, with a couple examples in each.
{{% /note %}}
---
{{% note %}}
both examples of what technically to do and how to do general things both examples of what technically to do and how to do general things
For example: For example: