Tag Archives: command-line tools

Yeoman Basics by example: A Ctools Content Type generator for Drupal


generator-ctools-content-type example

A few weeks ago I wrote a blog post about Yeoman and the existing Yeoman generators for Drupal. As someone who loves and rants a lot about code generation, it was a tool that I had been wanting to try out for quite some time, and the experience after having spent a couple of hours with the tool, figuring out which generators could be useful for me, was rather satisfactory.

Now, beyond having some generators that I can benefit from, my interest in Yeoman was mostly in the APIish side of it. In other words, I wanted to see how easy it is to create my own generators for whatever tasks I find myself repeating a lot. The best way to find that out is, of course, to try and write a generator plugin for it, facing the usual challenges of being a total newcomer to a language or a framework. One of the most common pieces of code I have to write in my projects, are ctools plugins, in particular, Content Type plugins, so I decided to write a generator for just those type of plugins. This post will explain the basics of the tool and how to create a basic generator. If you want to get the most out of it, I’d recommend you to open your IDE or text editor of choice, and follow along, so that you can experiment with Yeoman at the same time.

Continue reading

Yeoman Generators for Drupal: What’s out there?

drupal logoyeoman-logo

 

I’ve been hearing about Yeoman for quite some time now. Pretty much since the project took off, or soon after. As a tool born in the Javascript community, I came across this little gem when I was learning about Node.js and the different tools and frameworks available for it, either in my free time, or as part of my labs time at my company. Sadly, I didn’t really pay much attention to it. At the end of the day, Node.js was just something I was learning about, but not something I was going to be able to put in place or introduce in projects in the short term. Or, even if it was something I *could* do, it wasn’t in my plans, anyway.

The other reason why I didn’t look into it closer, was that I mistakenly thought it to be a tool only useful for Javascript developers. Some time ago I noticed that Yeoman was getting plenty of attention from other communities too, and in a closer look, I understood that it wasn’t a tool for Node.js, but instead, a tool built on top of Node.js, so I decided to give it a try and see if I could make something useful out of it for Drupal development. Continue reading

WP-CLI, where have you been all this time?

wp-cli

I’ve been recently trying to get back to blogging. In fact, I’ve beeen recently trying to do what I set out to do more than one year ago, when I created and launched this blog. For a number of reasons, which I may or may not cover in a future post, that intent has been replaced or delayed for quite some time, but it seems that I’m finally taking action to solve that.

One of the reasons that made me become a bit lazy on the matter, was the “hassle” to maintain the platform that I chose for blogging: wordpress. I’m not complaining about wordpress itself, which is a great blogging tool. However, having been a drupal developer for a few years now, I’m rather used to Drush. In the unlikely event you, the reader, don’t know what Drush is, I suggest you go and read the first paragraph of its readme, but to keep it quick, let’s just say that drush is “a command-line utility for drupal that let’s you tackle all maintenance and deployment aspects of a drupal project during its entire lifecycle.”. That’s the simplest definition I’ve come up with in a few seconds. If you don’t like it, I have others, too.

Continue reading