When I first started using Drupal a year and a half ago one of the first things that struck me about building out sites (that is, sites consisting primarily of Primary Links pointing at Page nodes) was that it building out a skeletal wireframe of a site gets tedious, especially if you have a lot of "static" pages; we're all familiar with the drill:
- Create a new node
- Enter the title
- Expand the Menu Settings fieldset
- Enter another title
- Pull down the parent item and scroll down
- Try and remember the weight of the previous item
- Submit
- Lather, rinse, repeat
At the time, I was still getting my feet wet with Drupal module development, and managed to put together some code that:
- Reads a YAML file containing a site outline
- Builds stub nodes for each page in the outline
- Builds nested menu links pointing to those nodes
- Builds nested path aliases based on the node titles
Why YAML? Because it lends itself to creating light-weight outlines in a text editor without lots of extraneous markup (like XML), and because I was able to find a PHP-based, open-source YAML parser called SPYC to do the heavy lifting for me.
I checked my nascent module code into Subversion, and promptly got distracted by something else... and because I haven't had to build many content-oriented web sites from scratch in the interim, I didn't think much about it until I stumbled across it this weekend. When I dusted it off and looked my code over, I was pleasantly surprised - it needed some cleaning up, but the core functionality worked, and more surprisingly there were still not any modules (that I could find) on Drupal.org offering this functionality; the only outline/import modules I could find deal with the Book module specifically, not site wireframing.
So, I cleaned it up and checked it into the Drupal.org contributions repository. It is still rough around the edges and as such the initial release is version 0.5. I would recommend trying it out on a sandbox site, and of course backing up your site database before using it in a production environment. Currently it's available for Drupal 5 because that's what the old code was written for, but I do hope to upgrade it to Drupal 6 eventually.
For more details and to download the module, please visit the official project page at http://drupal.org/project/bones.


YAML parse
Have you ever had any problems with the SPYC before?
Like the idea!
Informative post. Great article. Thanks for posting this one.
I hope that we can collaborate on these efforts to get this type of functionality into Drupal core before long.
Interesting
Thanks for the article. I am learning drupal and find some of the details are where I am having the most difficulty!
Good idea... there should also be a YAML API module
Great idea. It would be good to see a separate YAML API module as well for other modules that wish to leverage YAML (there are lots of potential uses... YAML is a nice clean way to specifiy data).
Ah this yaml
Just a sidenote: Read the whole text and thought you were talking about the yaml xhtml/css framework ;) http://www.yaml.de/en/home.html
Something like the yaml builder inside drupal maybe? http://builder.yaml.de/
However great progress! Just built a website prototype yesterday and allthough the single steps are made quick it sums up to quite some work in the end.
Drupal 6
Are you guys planning on doing a drupal6 port?
Yes
I'd definitely like to do a Drupal 6 port... if I hadn't had the Drupal 5 code lying around already I would probably have gone straight to Drupal 6. I want to get the D5 module to 1.0 (a little more testing, and perhaps integrating the Token module for the automatically generated paths) before turning my attention to Drupal 6.
A very good idea
I love your idea! It takes quite bit of effort to get a quick Drupal prototype up and running with lots and lots of configuration to do. Professional Drupal site builders could really use some tools to help make this process easier. Something like Bones together with installation profiles and/or preconfigured database dumps could speed things up quite a bit.
Configuration Framework and Patterns
Thanks for sharing and posting details about your project. Drupal really needs these capabilities and we've been working to address that as well.
We've created a Drupal module to called Patterns in order to accomplish the same task and allow general automation of Drupal setup and configuration:
http://drupal.org/project/patterns
We've been working on YAML support and breaking the core of the module into a separate Configuration Framework module:
http://drupal.org/project/configuration
It supports a lot of the Drupal core modules and CCK and Views as well. The Patterns module includes some sample Patterns that show the format, how they work and what you can do.
I hope that we can collaborate on these efforts to get this type of functionality into Drupal core before long.
I had not encountered
I had not encountered Configuration & Patterns before, I'll definitely have to check them out - it looks like quite an undertaking.
Post new comment