Spelling sugestions are displayed in a block.
Have you ever try to get data from your libraries and/or breakpoints in Drupal 8 ? Drupal 8 core does not provide a UI for this information. Â And sometimes is nice to have the ability to know your data from the UI. Instead of trying to hunt down all that information by searching many files. For this reason, I decide to write few modules that will allow you to get some of the libraries and breakpoint information from the UI.Â
- Project Page: https://www.drupal.org/project/libraries_ui
- Module Description: This module will provide a UI to display all libraries provide by modules and themes. Once libraries_ui is been installed visit /admin/config/media/libraries_ui to get all breakpoints information.
- Project Page: https://www.drupal.org/project/breakpoints_ui
- Module Description: This module will provide a UI to display all breakpoints provide by modules and themes. Once breakpoints_ui is been installed visit /admin/config/media/breakpoints_ui to get all
I went to Drupalcon NOLA and was looking for a new way to contribute, since there've been a lot of discussion about the front-end part, and after reading @dries blog post Turning Drupal outside-in I started looking at the field UI. I stumbled upon the core issue titled The options under the Add field drop-down describe the data you want to store, but the user was imagining the widget it would produce and decided that the outside-in approach might be a good approach.
Drupal Code Builder library is the new library which powers Module Builder. I recently split Module Builder up, so Drupal Code Builder (DCB) is the engine for generating Drupal code, while what remains in the Module Builder module is just the UI.
DCB is an extensible framework, so if you wanted to have DCB create scaffold code for a particular Drupal component or system, you can.
DCB's API is documented in the README. It's based on the idea of tasks: for example, list the hooks and plugin types that DCB has parsed from the site code, analyze the site code to update that list, or generate code for a module. There are Task classes, and you call public methods on these to do something.The generators
Broadly, there are three things you want to do with DCB: collect and analyze data about a Drupal codebase to learn about hooks and plugin types, report on that data, and actually generate some code.
The Generate task class is where the work of creating code begins. The other task classes are all pretty simple, or at least self-contained, but the Generate task is accompanied by a large number of classes in the DrupalCodeBuilder\Generate namespace. You can see from the file names that these represent all the different components that make up generated code.
Furthermore, as well as all inheriting from BaseGenerator, there are hierarchies which can probably be deduced from the names alone, where more specialized generators inherit from generic ones. For example, we have:
- API (this one's for your mymodule.api.php file)
However, these hierarchies are only about code re-use. In terms of PHP code, HookImplementation is only related to ModuleCodeFile by the common BaseGenerator base class. As the process of code generation takes place, there will be a tree of components that represents components containing each other, but it's important to remember that class inheritance doesn't come into it.
Also, while the generators in the hierarchies above clearly represent some tangible part of the code we're going to generate, some are more abstract, such as Module and Hooks. These aren't abstract in the OO sense, as they will get instantiated, but I think of them as abstract in the sense that they're not concrete and are responsible for code across different files. (Suggestions for a better word to describe them please!)
The process of generating code starts with a call to the Generate task's generateComponent() method. The host UI application (such as Module Builder module, or the Drush command) passes it an array of data that looks something like this:
[ 'base' => 'module', 'root_name' => 'mymodule, 'readable_name' => 'My module', 'hooks' => [ 'form_alter' => TRUE, 'install' => TRUE, ], 'plugins => [ 0 => [ 'plugin_type' => 'block', 'plugin_name' => 'my_plugin', 'injected_services' => [ 'current_user', ], ], ], 'settings_form' => TRUE, 'readme' => TRUE, ]
(How you get the specification for this array as a list of properties and their expected format is a detailed topic of its own, which will be covered later. For now, we're jumping in at the point where code is generated.)Assembling components
The first job for the Generate task class is to turn this array of data into a list of generator classes for the necessary components.
This list is built up in a cascade, where each component gets to request further components, and those get to request components too, and so on, until we reach components that don't request anything. We start with the root component that was initially requested, Module, let that request components, and then repeat the process.
This is best illustrated with the AdminSettingsForm generator. This implements the requiredComponents() method to request:
- a permission
- a router item (on Drupal 7 that's a menu item, but in DCB we refer to these a router item whatever the core Drupal version)
- a form
In turn, the Permission generator requests a permissions YAML file. You'll see that there are two Permission generators, each with a version suffix. The Permission7 generator requests a hook_permission() hook, which in turn requests a .module file. The Permission8 generator is somewhat simpler, and just requests a YMLFile component.
Meanwhile, the router item requests a routing.yml file on D8, and a hook_menu() on D7.
These two parts of the cascade end when we reach the various file generators: ModuleCodeFile and YMLFile don't request anything. The process that gathers all these generators works iteratively: every iteration it calls requiredComponents() on all the components the previous iteration gave it, and it only stops once an iteration produces no new components. It's safe to request the same component multiple times; in the D7 version of our example, both our hook_menu() and hook_permission() will request a ModuleCodeFile component that represents the .module file. The cascade system knows to either combine these two requests into one component, or ignore the second if it's identical to what's already been requested.
We now have a list of about a dozen or so components, each of which is an instantiated Generator object. Some represent files, some represent functions, and some like Hooks represent a more vague concept of the module 'having some hooks'. There's also the Module generator which started the whole process, whose requiredComponents() did most of the work of interpreting the given array of data.Assembling a tree of components
The second part of the process is to assemble this flat list of components into a tree. This is where the notion of which component contains others does come into play. This is a different concept from requested components: a component can request something that it won't end up containing, as we saw with the AdminSettingsForm, which requests a permission.
The Generate task calls the containingComponent() method on each component, and this is used to assemble an array of parentage data. There's nothing fancy or recursive going on here; the tree is just an array whose keys are the identifiers of components, and whose values are arrays of the child component identifiers.
This tree now represents a structure of components where child items will produce code to be included in their parents. One part of this structure could be represented like this:
- router item
Some components, such as the Hooks component, are no longer around now: their job was to be a sort of broker for other components in the requesting phase, and they're no longer involved. The root component, Module, is the root of the tree. All the files we'll be outputting are its immediate children. (This is not a file hierarchy, folders are not represented here.)Assembling file contents
We now have everything we need to start actually generating some code. This is done in a way that's very similar to Drupal's Render API: we recurse into the tree, asking each component to return some content both from itself and its children.
So for example, the router items contribute some lines to the routing.yml file, which then turns them into YAML. The .install component, which is an instance of ModuleCodeFile, produces a @file docblock, and then gets the docblock, function declaration, and function body from the hook_install component, and glues them all together.
Finally, each file component (the immediate children of the module component in the tree) gets to say what its file name and path should be.
So the Generate task has an array of data about files, where each item has a file name, file path, and file contents. This is returned to the caller to be output to the user, or written to the filesystem. Module Builder presents the files in a form, and allows the files to be written. The Drush command outputs them to terminal and optionally writes them too.Extending it with new components
The best way to add new things for DCB to generate is to inherit from existing basic classes. If these don’t provide the flexibility, there’s always a case to be made to give them more configurable options: for example, the AdminSettingsForm class inherits from Form, but neither of those do very little for the actual generated form class, as the work for that is mostly done by the PHPClass class.
The roadmap for DCB at the moment consists of the following:
- Generalize the injected services functionality that’s already in Plugins, so generated Form classes and Services can have them too.
- Add Forms as a basic component that you can request to generate. (It’s currently there only as a base for the AdminSettingsForm generator.)
And as ever, keep adding tests, keep refactoring and improving the code. But I'm always interested in hearing new ideas (or you know, better yet, patches) in the issue queue.
This module provides an API to interact with the Mandrill Inbound Email
Processing system. Modules are then able to use this API to setup email
patterns to receive emails and callbacks to process them.
I love street photography. Walking and shooting. Walking, talking and shooting. Slightly pushing me out of my comfort zone looking for that one great photo.
Street photography is all fun and games until someone pulls out a handgun. The anarchy sign in the background makes these shots complete.
For more photos, check out the entire album.
It has been nearly a year since I’ve updated the status of my camp recording kits. Since DCSTL15, two other camps took me up on my proposal to sponsor my travel and hotel in exchange for me recording and posting their sessions: TCDrupal and BADCamp. And, of course, as a MidCamp organizer, that counts too. And with each those camps, I’ve iterated and learned from invaluable successes and failures.
First off, here is a link to the current kit.
With everything, each kit is still under $450. In addition, zip ties to hold the VGA to HDMI dongle tight and some gaffers tape to secure everything to the podium are needed.Recap
At Twin Cities, I learned that, while I try, I cannot reasonably start and stop every recording in every room, especially at camps with five concurrent sessions spread over multiple floors and buildings. The amount of volunteer participation at TCDrupal is incredibly impressive. I had loads of help at my disposal, but only a few moments to outline how the kits work, so I spent a lot of time troubleshooting from room to room.
BADCamp is another camp that sprawls over a campus and is a bit looser on the room monitor support. So this time, I came armed with printed instructions at each podium for hooking up to the kit (link). I added some basic troubleshooting and my phone number. I missed about half the session starts, but speakers were mostly able to follow the instructions and run things without me. That was a huge win. Unfortunately, remembering to also start/stop the audio record was hit or miss.
By the time MidCamp rolled around, I simplified the instructions further and also set the backup audio record to just run all day, removing the failure point of missed audio. The big red button is easy and enticing. The little button on the audio recorder remote...not so much. MidCamp, with two days of four concurrent sessions was my first 100% captured camp since St. Louis.Pain Points
There are four recurring issues with this setup:
- VGA-only laptops
- Recurring audio problems
- File segmenting
- Random projector problems
Hopefully, the time of laptops that only have VGA out is coming to an end. I've tried several different VGA-to-HDMI converters with basically no luck. And to spend hundreds of dollars or more for a fool-proof converter when modern laptops have better video output is a hard pill to swallow. I don't foresee this being a long-term problem.
The audio issues are baffling. In some cases, no audio at all is recorded with the screen capture, while other times it is sped up and choppy, hence the importance of the backup audio files from the voice recorder. But this means post-processing time which delays uploads. I intend to contact Hauppauge support, but honestly don't expect to get very far as I am using their device as it was not intended. Lastly, the capture device has a touch panel for adjusting gain and muting the audio. It is a little to easy to accidentally mute the audio.
Minor annoyance: occasionally, the recordings will split into two or more files, meaning I have to stitch them together in post.
At MidCamp for the past two years (both held at different locations on UIC campus), some of the projectors would intermittently go dark during presentations. While this has no impact on the recording, it is extremely unsettling for the presenter and annoying for the attendees. I recall this happening in some cases at Twin Cities, but not at BADCamp. So this one currently has me stumped with no good plan of resolution at this time.Next Steps
For obvious reasons, I can't record all the sessions at all the camps. And already I have firm plans to record Twin Cities in June, St. Louis in September, and BADCamp in October. Talking to folks at Drupalcon, I also now have soft commitments with Drupal GovCon in July and Drupal Camp New Jersey in January. And other camps have reached out, but I have conflicts.
I managed to pack up a complete kit into a 10" Pelican case. This means that if I can start training some proxies and write up some detailed instructions and troubleshooting, then this solution can scale. Maybe folks won’t have experience with the post-production, but I can help with that remotely, if needed. The beauty of these kits is that with timely starts and stops and good audio, the MP4 file on the thumb drive can be uploaded as soon as it is collected.
The good news is that the more camps I can record, the more data I can collect and the more I can refine the process to make it scalable.
My first day on the job, I got on an airplane and flew to Australia to attend DrupalCon Sydney. As first days on the job go, that’s gotta be up there as one of the best. It definitely set the tone for life in the Drupal community - it’s been an exciting adventure every single day. I’ve traveled around the world, worked with incredibly smart people, and learned four or five Git commands (thanks Cathy!).
So it’s not without some sadness that I share that my last day on this job will be June 3. Why am I leaving? Simply put, because I can. Drupal 8 is out and thriving. The Association is doing more and doing it better than it ever has. Now is the time for me to take a step back, eat some cake, and then find something new to jump into (after a nap, and probably some more cake).
Luckily, the Drupal community has an amazing individual ready to step in to lead the Association. I’m proud beyond words to see Megan Sanicki take on these challenges and work with you all as the next Executive Director of the Association. I know she will continue to build an Association that operates from its values for and with the Drupal community. We’ve been working together on this transition for a little while now, and I can’t wait to see what she does.
I just want to share a couple of thanks before I go. First, I’m deeply proud of the team that we have built at the Drupal Association. The Drupal Association staff are the rainbow unicorns of teams. They are honest about their opinions, but kind in their delivery. They are fierce in their loyalty to the community, and even more so in their loyalty to each other. They genuinely care about every interaction, and even when things go sideways, you can trust that their intentions were nothing but good. I learned from them. Every. Single. Day. I owe them a heck of a lot more than this thank you, but I wanted to get it out in the world. They are the best. Treat them well.
Secondly, I want to thank the dozens of community members who have gone out of their way to support me in this role. I’ll be following up personally with as many of you as I can, but I wanted to call out a few of you in particular. Angie taught me that introverts can learn to like hugs. George and Tiffany taught me to take my time and find the exact right words. Paul taught me that you can’t have too many passion projects. Donna taught me that it’s not summer everywhere. Cathy taught me Git (well, four or five commands that I can remember). There is so much generosity in Drupal.
The Association board and Megan will be working hard over the next few weeks on this transition to make sure that we continue to grow our support of the community, keep producing amazing DrupalCons, and ensure that Drupal remains the best darn CMS out there. I’ll be over here rooting for all of you. You’ll find me next to the cake.
One of the best things to happen with the Drupal 7 release was the introduction of Entities. Drupal Entities have been around forever, but it seems like a lot of developers still refer back to using Nodes when creating content that requires more functionality than what Nodes give you out of the box. In this video, I talk about why it’s a good idea to create your own Entities when the content you’re adding requires extended functionality. I talk about the “what” and the “why” of Entities, not necessarily “how” to create an Entity. There are a bunch of resources already out there on the Internet for that. I talk about using the Entity API module, and defining your own Class for your custom Entities. This presentation was given at SandCamp 2016.Read more...
Thank you so much for attending DrupalCon New Orleans. We had an amazing time and hope that you did too.
After each Con, we ask that you please let us know how it went so we can see what we can improve for next time. Please
We also understand that you may be interested in receiving a Certificate of Attendance. If so, please fill out the request form and we will get back to you shortly.
Placeholder project for managing sponsors on your site or an event. Used in the Conference Organizing Distribution.