So, what’s Yeoman then? It’s a code scaffolding tool. That is, it’s an utility to generate code for web apps. What’s the purpose of that? Well, the purpose is that developers save time by quickly generating the skeleton of the web apps they build, leaving more time for the important things, such as the most complex business logic of the app, integrations, testing, etc… In short: it’s a tool that should help developers deliver more quality in their apps. To get a better picture of what Yeoman can do, I’d point everyone at their site, which has some nice tutorials and a very good documentation for writing your own generators.
My plan was to write a few generators for the most common pieces of boilerplate code that I normally have to write in my projects. Unsurprisingly, I found that there are a few yeoman generators for Drupal already out there, so I thought I should review them and see if they’re of any use to me, before writing one that already exists. Yes, that can be a boring task if there are too many generators, but I was lucky that there aren’t *that* many for Drupal, so I just spent a couple of hours testing them and documenting my findings. Hopefully, this blog post will help other Drupal developers to find out in a matter of minutes whether the existing generators are useful for them or not. So, let’s get into it!
Github repository here. Creation date: Around 2 years ago.
module: |- drupalmodule.css |- drupalmodule.info |- drupalmodule.js |- drupalmodule.module |- package.json
This one scaffolds a basic structure for a simple module. Needs bower and a package.json file to download dependencies, but not a problem anyway since you’ll probably have drush. Creation is a bit unintuitive: you need to create the module folder first, cd into it, then execute yo drupalmodule.
The generator asks if you want JS and CSS files, but it doesn’t even add functions to add them to the page. It’s a generic purpose generator, and doesn’t have anything that is not in module_builder already.
Github repository here. Creation date: Around 2 months ago. Latest commit about 2 weeks ago.
module: |- templates (if hook_theme chosen). |- drupal_module.info |- drupal_module.install |- drupal_module.module
More neat than drupalmodule in the surface, but doesn’t do much more. It asks us if we want hook_theme(), hook_menu(), hook_permission() and hook_block_info / view implementations, which is nice, yet that doesn’t make it much of a gain compared to other simple scaffolding tools, like PhpStorm live templates. In contrast to the drupal-module generator, this one doesn’t ask us if we want a CSS or JS file.
Github repository here. Creation date: 9 months ago. Latest commit about 6 months ago.
Structure created (“publisher” entity):
Views and license files are optional, based on the settings specified in the command-line.
module: |- views |- publisher.views.inc |- publisher_handler_delete_link_field.inc |- publisher_handler_edit_link_field.inc |- publisher_handler_link_field.inc |- publisher_handler_publisher_operations_field.inc |- LICENSE.txt |- publisher.admin.inc |- publisher.info |- publisher.install |- publisher.module |- publisher.tpl.php |- publisher-sample-data.tpl.php |- publisher_type.admin.inc
Generates a full drupal module for a custom entity, based on the structure proposed by the model module.
One issue I experienced is that if I select to “add bundles”, the Field API screen seems broken (doesn’t load). However, a general “fields” tab appears, but if you try to add a field, you get some errors and get redirected to a 404. So, bundles are offered on the plugin creation menu, but not really supported! Same for revisions. It’s asked on the command-line prompt, but doesn’t seem to do much. Not choosing bundles support, still lets you add bundles on the admin UI, and doesn’t seem to break anything, though.
In spite of the issues I had testing it (I didn’t bother much investigating what was the issue), it seems to me an useful generator. The only reason why I doubt I’ll be using it, is that it’s based, as mentioned, on the model project for Drupal, which is quite nice, but rather outdated now (4 years old), and doesn’t leverage some of the latest Entity API goodies. Also, I’ve developed some opinions and preferences around how to structure custom Entity Types, so starting to use the model approach would be, in a sense, a step backwards.
Github repository here. Creation date: 5 months ago. Latest commit about 14 days ago.
my_layout: |- admin_my_layout.css |- my_layout.css |- my_layout.inc |- my_layout.png |- my-layout.tpl.php
Generates a ctools layout plugin folder structure, with all the files needed to get it to work out of the box. It makes no assumptions about how the content will be displayed, so there’s no styling by default (which is perfect), and it allows to specify as many regions as desired. It’s quite likely that I start using this in my projects. No cons or negative aspects to mention!
Github repository here. Creation date: 1 month ago. Latest commit about 1 month ago.
This one, rather than a code generator for Drupal elements, is a yeoman generator to serve as an scaffolding tool for another repo from Phase 2. While I didn’t get to test it out, the grunt-drupal-tasks repo really looked interesting (check the features here), and I might try to give that a go, although I’m familiar with Gulp and not with Grunt. Long story short: very interesting project, but it’s not meant to scaffold any code for your drupal modules.
Github repository here. Creation date: 6 months ago. Latest commit about 3 months ago.
drupalformat: |- includes |- js |- drupalformat.settings.js |- theme |- drupalformat.theme.inc |- drupalformat.tpl.php |- drupalformat.api.php |- drupalformat.info |- drupalformat.install |- drupalformat.module |- drupalformat.variable.inc |- generator.json |- LICENSE.txt
Github repository here. Creation date: 6 months ago. Latest commit about 3 months ago.
drupal_component: |- ctools-content_types |- drupal_component.inc |- drupal_component.scss |- drupal_component.html.twig |- drupal_component.info |- drupal_component.js |- drupal_component.module |- drupal_component.tpl.php |- drupal_component.views.inc
I found this one rather peculiar. The boilerplate code it produces is rather basic, yet offers options such as creating a views style plugin by default, or a ctools content_type plugin. The good thing is that each component can be generated individually, which is rather convenient. The only issue that keeps me from using it is that, again, none of the components offer any options particularly advanced that could benefit from having an interactive tool like Yeoman (e.g: asking whether the ctools content type plugin will need one or more settings forms). For my particular case, I can generate all of these easily with PhpStorm live templates or template files easily.
Is that all, folks?
Ye… no! There are indeed a few more generators thought around drupal projects in the Yeoman registry (click here and search by “Drupal”). Some of them are very interesting, to do things such as:
- Scaffold a headless Drupal backend with Angular, or a headless Drupal backend with Backbone Marionette.
- Generate a Drupal theme, or another Drupal theme, or YET another Drupal theme.
- Scaffold a whole development stack for Drupal.
However, I decided to leave those out of an in-depth review because, as interesting as they are, they cover several aspects of Drupal development, and people often has very specific preferences about how to structure a theme, for example, or what tools to use in order to create a Headless Drupal.
Since the goal of this article was to give a bird’s eye view of what generators Drupal developers can use right now without changing anything in the way they work, I preferred to describe mainly the generators done around drupal modules, and more specific components. Hope this blog post has saved you some time. Expect to see a new one on this topic as soon as I’ve written my first Yeoman plugin.
Launching a website is just the beginning of a process. Websites need nurturing and care over the long run to stay relevant and effective. This is even more true for a service or tool such as LibraryEdge.org. Why would users come back if they can only use the provided service once or can’t see progress over time? And how can you put that love and care into the service if it is not self-funded?
This month, LibraryEdge.org released a number of changes to address just these issues.Helping Libraries Stay Relevant
Before we dive into the release, here’s a bit on the Edge Initiative.
With the changes created by modern technology, library systems need a way to stay both relevant and funded in the 21st century. A big part of solving that problem is developing public technology offerings. Even in the internet-connected age, many lower-income households don’t have access to the technology needed to apply to jobs, sign up for health insurance, or file taxes, because they don’t have personal computers and internet connections. So where can people go to use the technology necessary for these and other critical tasks? Libraries help bridge the gap with computers and internet access freely available to the public.
It’s important that libraries stay open and are funded so their resources remain widely available. By helping library systems improve their “public access computers/computing,” the Edge Initiative and its partners have made major strides in making sure libraries continue to be a valuable resource to our society.
That’s where LibraryEdge.org comes in. The Edge Coalition and Forum One built LibraryEdge.org in 2013 as a tool for library systems to self-evaluate their public technology services through a comprehensive assessment – plus a series of tools and resources to help library systems improve their services.New Functionality
The biggest feature update we recently launched was enabling libraries to retake the Assessment. They can see how they have improved and where they still need work compared to the previous year. To create a structure around how libraries can retake the Assessment, we built a new feature called Assessment Windows. This structure allows the state accounts to control when the libraries in their states can take the Assessment. States now have control over when their libraries conduct the Assessment and can track their libraries’ goals and progress on Action Items. This feature allows states to more accurately assess the progress of their libraries and adapt their priorities and programming to align with library needs.
The Edge Toolkit was initially built to allow users to view their results online, along with providing downloadable PDF reports so libraries can easily share their results with their state legislatures and other interested parties. Now that libraries can have results for two assessments, we’ve updated the online results view and the PDFs. Libraries can now see a side-by-side comparison of their most recent results with their previous results.
It’s common knowledge that people retain more of what they see, so we’ve also visualized important pieces of the results data with new graphs. If a library has only taken the assessment once, then the charts will only display its highest and lowest scoring benchmarks. However, if they’ve taken the assessment a second time, they can also see bar graphs for the most improved and most regressed benchmarks.
Improved User Experience
We made a number of enhancements based on feedback from libraries that have been using the tool for the past couple of years, as well as from interviews that we conducted with State Library Administrators. Starting with a series of interviews gave us great insight into how the tool was being used and what improvements were needed.
The added functionality of being able to retake the Assessment increased the level of complexity for the Edge Toolkit. So we redesigned the interface to guide users through this complex workflow. We split out the Toolkit into four sections: introduction/preparation, taking the assessment, reviewing your results, and taking action. This new workflow and navigation ensures a user is guided from one step to the next and is able to complete the assessment.
Several dates and statuses affect a library system as they work through the assessment, such as how long they have to take it and whether it is open to be retaken. We’ve implemented notifications that inform the user of this information as they are guided through the workflow.
When we release new features, we need to ensure other components on the site don’t break. Testing this complex of a system can take a long time and will get expensive over the lifetime of the site if it’s done manually. Furthermore, testing some sections or statuses involves taking a long assessment multiple times. In order to increase our efficiency and save time in our quality assurance efforts, we developed a suite of automated tests using Selenium.What’s Next for Edge
The updated LibraryEdge.org now allows libraries to assess their offerings again and again so they can see how they are improving. Additionally, we’ve built a paywall so Edge can be self-supporting and continue to provide this valuable service to libraries after current funding ends. The launch of this updated site will help Edge remain relevant to its users and, therefore, ensure libraries remain relevant to our communities.
Design work is a lot of show-and-tell. It can be challenging to effectively communicate and collaborate on a distributed team. Join hostess Amber Matz, Lullabot Creative Director Jared Ponchot, Lullabot UX Designer Jen Witkowski, and Justin Harrell, Interactive Designer for Drupalize.Me, as they talk about the unique challenges, processes, and tools they use as part of a distributed team.
At the time of this writing, just under 300,000 websites use the Drupal Backup and Migrate module. It is an great tool for moving databases from production back to staging and development servers, and it is an essential tool for automatic backups of the database and files of the production server.
About a year ago, Version 3.0 was released, which integrated the offsite functionality from another module, and brought additional functionality, like files and code back ups. This is what I would like to go through today in the steps below.
Why offsite backups?
I hope by now everyone has heard of the Backup 3-2-1 Rule. If you haven't, it is a good thing to strive for in all things digital. The rule mentions "In case your house burns down", but in our case, with web servers, there are a lot more risks. The server could get hacked. The developer or client could accidentally delete. The hosting company could go out of business. There are probably a lot more reasons that I sudder to think about!
If only non-Finns could easily pronounce it, I think "yhteisöllisyys" would be a perfect motto for Drupal. To explain what it means, I dragged Lauri Eskola, Drupal Craftsman from Druid.fi, away from the contribution sprints at DrupalCamp Brighton 2015 long enough for him to fill me in on that, as well as his trip to Drupal Camp Delhi 2015, what he's excited about in Drupal 8, and how doing business in the Drupal world–based on values like sharing and openness–must seem strange and different to outsiders.
Drupal allows you to easily change the order of your displayed fields using the Manage Display option for your content types but it does not allow you to change the order of the title field (because this field is rendered directly from the node template). But there may be times that you want to display your custom field(s) before the title field. For example, if you have an image field that you want to float to the left of your title and remaining node content.
Another month, another swath of work to improve our favorite content management system.
The Usual (Contrib) Suspects
Once again some of our main achievements during March was on client-sponsored work, most notably:
Over the past few months I have been banging my head against a problem at MSNBC: importing the site's extremely large database to my local environment took more than two hours. With a fast internet connection, the database could be downloaded in a matter of minutes, but importing it for testing still took far too long. Ugh!
In this article I'll walk through the troubleshooting process I used to improve things, and the approaches I tried — eventually optimizing the several-hour import to a mere 10-15 minutes.
You’ve heard about it, read about it, and – if you’re like me – dreamed about it. Well, its time to stop dreaming and start doing.
If you have experience building sites using Drupal 7, you’ll be pleased to see that from a site building and administration perspective, things are nearly the same.
And if Drupal 8 is your first Drupal experience, you will be pleasantly surprised at how easy it is to build an amazing site.
First things first.
You’ll need a basic set of software installed and operational on your laptop, desktop, or server before proceeding with the Drupal 8 installation. Drupal requires that Apache, MySQL, and PHP are installed and working before beginning the installation process. There are several ways to easily install the required software using LAMP (Linux, Apache, MySQL and PHP), WAMP (Windows), or MAMP (Mac) solutions. Grab Google and do a quick search.
Good. Now there are five basic steps to install Drupal:
- Download the latest version of Drupal 8
- Extract the distribution in your Apache
- Create a database to hold the content from the site
- Create the files directory and settings.php
- Run the installation process by visiting your website in a browser
For details on the installation process visit http://wdog.it/4/1/docs.
These are the basic building blocks that will provide the foundation for your Drupal 8 site:
- Content types
If your site is simple and you’re the only one who will be authoring, editing, and managing content, then the admin account you created during the installation process may be all that you need. In situations where you want to share the content creation and management activities with others, you need to create accounts for those users.
The Drupal Simplify Module is a big help removing cruft from the eyes of the administrator in the Drupal UI. Simplify allows you to hide certain fields from the user interface on a global basis, or configured for each node type, taxonomy, block, comment, or user.
What sent me looking for a module like this was the "Text Format" selection beneath every single WYSIWYG on the site. While I think Drupal is incredible for allowing multiple input formats, 99 out of 100 times, I define which ONE input format a user can use per role. So having this as an option beneath every rich text editor on the site just became wasted space that I wanted to remove. And so I did!
But wait, there's more! Simplify lets you hide so much more than that! The following items can be hidden:
- Administrative overlay (Users)
- Authoring information
- Book outline
- Comment settings
- Contact settings (Users)
- Menu settings
- Publishing options
- Relations (Taxonomy)
- Revision information
- Text format selection
- URL alias (Taxonomy)
- URL path settings
- Meta tags
- URL redirects
- XML sitemap
Install Simplify for Drupal 7
- So, let’s start out by talking about the genesis of your session. What made you think this topic needed to be covered?
- What’s the problem with just installing another module?
- What if I don’t program?
- Reuse modules
- Push back on requirements
- Make sure the cost of adding another module is not just the cost of the time it takes to install it
- Simple modules really aren’t programming
- What are the potential problems with custom code?
- How do you determine if you should install a module or write some custom code?
Not really telling people to avoid specific modules more about thinking twice when they select them.
* Entityform vs. Webform
* Entity View Modes
* Page title
* Commerce Custom Order Status
We are growing, we are hiring... well not in a sense of spending money, but the #d8rules initiative is proud of already having 26 contributors who got their pull requests merged on github. But how did that happen and what exactly happened since our last update by the end of last year? Drupal Dev Days Montpellier are definitely the most exciting part of this list so we'll keep it for the end :)
We travelled all around South America and Europe to give people an update on the initiative, including DrupalCon Latin America Bogotá, DrupalCamp London, European Drupal Days Milano, Drupal Dev Days Montpellier. You can watch a video recording on youtube.
Workshops & Sprints
At Global Sprint Weekend Zurich we sprinted with some first-time #d8rules contributors mainly on porting actions. For example, vasi worked on porting some actions but also dermario and me started working on a Rules component admin UI.
At European Drupal Days Milano, we did a full workshop to teach new contributors the underlying concepts of Drupal 8: dependency injection, plugins, typed data, unit tests etc. With the following sprints, we were able to make good progress with porting actions. Special thanks to bojanz for writing the first derivative plugin: The Entity create action plugin will generate derivatives based on the entity types available, for example "Create a new user", "Create a new node".
Drupal Dev Days Montpellier
We have counted at least 20 people involved in the #d8rules sprints last week in Montpellier, France which is well - awesome and a bit overwhelming at the same time :) Thanks to the great excitement of so many new and recurring contributors, we were able to make major progress not only by finishing most of the action ports but also by starting work on other areas of the Rules module and its integrations. You can find a more detailed summary of everyone has been working on in our meeting minutes. Let me name a few examples:
- mariancalinro wrote the first automated tests for derivative plugins, picking up bojanz' work, investigated about the extracting the Views fields & filters selection widget and started mentoring other sprinters on that topic.
- a.milkovsky ported various actions, started working the Rules settings UI and also mentored other contributors with the gained knowledge.
- czigor ported various actions and started the porting the first Flag action. I won't repeat has mentored others because one of the most exciting parts of this sprints was seeing everybody mentor each other on what they know.
- katia and pjezek also dove deep into porting the flag and unflag actions.
- Steve Purkiss amongst porting actions started extending the Rules documentation.
- nielsdefeyter picked up the work on the Rules component UI and helped us to get it together with a Rules UI skeleton committed during dev days.
- lewisnyman helped us define personas, user stories & user journeys in order to validate the usabliity of the Rules 7.x UI and target improvements for the Rules UI in 8.x
- m1r1k did reworked the logging service and even started integration with webprofiler
- xano joined us for the discussion on implementing a generic plugin selector widget and even created Plugin Selector as a spin-off from what he implemented for payment.
- fubhy started implementing a lexer/parser for mathematical expressions
- nlisgo, claudine, branislav, mikl & martin also joined us for porting actions & cleaning up inconsistencies in the code base
- klausi, fago & fubhy provided guidance, reviews & were able to merge many pull requests besides working on improvements of the Rules engine
Thank you so much everyone for participating and helping out! I hope I covered most of the things. Personally, I was really glad to be able to focus on motivating people. Somehow it felt like we all got into a good flow with a self-organising team that started mentoring & reviewing each others work.
It isn't over yet
As we gained so much good momentum during the recent sprints, we would like to invite everyone interested in joining our weekly calls on Google hangout: every Thursday at 4:30pm CEST we announce them on IRC: #drupal-rules. Also check out the meeting notes.
I'm running endlessly through the woods, as far away from Silicon Forest/Valley as I can. Facebook has collapsed, so has Google, so has everything. A post-social media, free internet, apocalyptic world has ensued and all of the developers have gone into the woods to escape the aftermath clutching their now worthless laptops. In my dream all the CEOs of the software companies are in a room patting themselves on the back for giving it a good go, while the world falls apart in the aftermath of their self-focused existence.
This may have just been a crazy post White God viewing dream I had, but it touches on something real. Something that as a consultant for multiple companies I see all the the time.
And it's killing me. It's killing your company, and you're too busy getting beers with your funders to notice. Meanwhile your developers, project managers, and everyone else that is the core of your business is slowly burning out until they rage quit and go somewhere else to start it all over again.Read more
As the potential release date for Drupal 8 slowly creeps up we've launched our first Drupal 8 site and are planning to kick off several more in the next few months. Through this process we've learned a lot about the reality of what it means to launch a site on beta software and what that means for your next project.
When do you need it done by?
Drupal 8 will be here soon, but your project may not need to be. If you are just starting to think about the strategy for your project now, and aren't planning on going into heavy development until later this summer, you should definitely be considering Drupal 8 as an option.
Happy Earth Day! Since the last Drupal Core Update, the Drupal Developer Days event brought lots of exciting progress: we (briefly) reduced the number of critical issues to 35, and a week-long performance sprint made Drupal 8 2—20 times faster! Also, Gwendolyn Anello at DrupalEasy announced that DrupalEasy is partnering with Stetson University to offer Drupal courses!
Some other highlights of the month were:
- Pratomo Ardianto at X-Team developed an in-depth tutorial on theming in Drupal 8, Christopher Hall continued his series on theming in Drupal 8 with a breakdown of responsive breakpoints, and Wim Leers posted a tool to visualize Drupal 8's render tree.
- On the front-end, Phase 1 of the Consensus Banana initiative (moving CSS clases from preprocess functions to Twig templates) was completed, the
activeclass was changed to
is-active, and we fixed a bug where CSS in libraries would override CSS in themes.
- To improve developer experience, the
user_namehandler is now handled by the Field API, and the Entity display class no longer depends on the field module.
- Joe Shindelar shared some tips & resources to get started with Drupal 8, Jimmy Berry unveiled a Drupal testbot command-line tool so you can run the full Drupal test suite on your local machine, Mark Ferree at Chapter Three shared his presentation on Drupal 8 module development, and Ray Saltini at Blink Reaction wrote a brief introduction to the Drupal Console project.
- Internal page caching was moved into a module so it can be easily turned off for development, core now uses the APC Classloader by default if it's available, and showing comments no longer requires generating temporary users for anonymous users.
- Mike Potter at Phase2 announced the Features module for Drupal 8.
- To clean up the API,
drupal_form_submit()were all removed, and
entity_load_multiple('image_style')were replaced with static method calls.
- Lauri Eskola at Druid wrote about his team's experiences launching a site on Drupal 8, John Locke at Freelock explained when Freelock recommends using Drupal 8 now, Kristof Van Tomme at Pronovix explained the Drupal 8 Accelerate funding program and how Pronovix is encouraging their customers to help, Chris Smith at OPIN Software Inc. interviewed Chris Luckhardt about Drupal 8, it's release date, and it's impact on the community, and Steve Burge at OSTraining announced a kickstarter to create free Drupal 8 training videos.
- Also, PHP7 EngineExceptions can now be caught in the general error handler and we can now perform front-end testing with the Mink driver.
How can I help get Drupal 8 done?
See Help get Drupal 8 released! for updated information on the current state of the release and more information on how you can help.
We're also looking for more contributors to help compile these posts. Contact mparker17 if you'd like to help!Drupal 8 In Real Life
- Cornell Drupal Camp starts tomorrow, April 23–24 in Ithaca, NY, USA with sessions on Drupal 8 for site builders, unit testing with PHPUnit, an introduction to Drupal 8 for end-users, and migrating Drupal 6 sites to Drupal 8.
- On Friday, April 24, there is a code sprint to port Views GeoJSON to Drupal 8 in Durham, NC, USA.
- The Village of Oak Park Drupal User Group is hosting a Drupal 8 core sprint on May 3 in Oak Park, IL, USA.
- DrupalJam will be taking place on April 30 in Utrecht, Netherlands with sessions on headless Drupal 8, responsive images, and continuous integration.
- DrupalCon Los Angeles in Los Angeles, CA, USA is only 19 days away (May 11–15, although sprints start on the 9th)! Regular ticket pricing ended last week, but late tickets are still available.
- DrupalCamp Spain will be May 22–24 in Jerez de la Frontera, Cádiz, Spain! There are still tickets left, and members of the Asociación española de Drupal get a 10% discount! There are sessions on Drupal 8 forms, theming, site-building, and building multilingual sites in D8.
- The Drupal North Regional Summit in Toronto, Ontario, Canada will be June 25–28. Registration is free, but you should register now so the event organizers can plan for you to be there. The event’s theme is Drupal 8!
- DrupalCamp Ottawa announced their new date and location: Friday, July 24 at University of Ottawa, Ottawa, Ontario, Canada.
Do you follow Drupal Planet with devotion, or keep a close eye on the Drupal event calendar, or
git pull origin 8.0.x every morning without fail before your coffee? We're looking for more contributors to help compile these posts. You could either take a few hours once every six weeks or so to put together a whole post, or help with one section more regularly. If you'd like to volunteer for helping to draft these posts, please follow the steps here!