Want to get Lullabot article, videocast, and podcast announcements delivered right to your in-box?
Let us know your email address (we won't share it) and we'll let you know when anything exciting happens.
The sites, they are a'changin'
The past several weeks have been pretty busy, hopping around with various clients and helping them iron out architectural issues in the early plans for their sites. With each new site project we work on, it seems like all of the Lullabots have been watching the 'hot spots' of work move from pure code (writing custom modules, etc.) to architecture and configuration.
Drupal has reached a point where 80-90% of the functionality of most sites can be built using nothing but Drupal core, CCK, Views, and a few dozen third-party modules. That impressive stat is made possible by Drupal's architecture, and the steadily increasing quality of many key modules in the contrib section. Unfortunately, it also means that Drupal is currently in a scary 'gray zone' between roll-your-own and plug-and-play.
In the dark ages of Drupal 4.6, and even 4.7, if you wanted your site to offer a news section, a free job posting section, and a photo gallery, the answer was simple if sometimes frustrating. You installed image.module, you hunted around in contrib for a Classified Ads module, and you used something like Taxonomy to organize story nodes into a news section. There were rough edges, of course. If you wanted to do something slightly different -- say, listing the location of a particular job when the Classified Ads module didn't support it -- you had to dive right into the code and start hacking. Photo galleries grouped by month rather than taxonomy term? Same issue. Functionality for sites was implemented by relatively 'monolithic' modules that provided custom content types, pages to display and organize them, etc. in one package. If you needed something that worked differently, you hacked one of those modules or you rolled your own from scratch.
Today, the situation is quite a bit different. While those kinds of modules still exist, much more emphasis is put on designing your own content types from scratch using CCK and a bag full of Field Type plugins. Then, you roll your own listing pages and filtered RSS feeds using Views module. In almost all cases, the resulting functionality is the same or better, and you can tailor the data model and presentation to your site's specific needs. It makes it quite a bit easier to build your site just so without re-inventing the wheel.
The trade-off, though, is increased complexity for the folks who don't need that high level of customization. If all you want to do is add a browsable gallery to your blog, installing CCK, Views, Imagecache, Imagefield, Views_Grid, and so on, then configuring each of them to work together an produce your Perfect Image Gallery... Well, that's a daunting task. Building a wiki in Drupal is similar -- you combine six or seven modules, configure them to taste, and voila! Wiki! To do that, though, you need to figure out how they all work together and what the correct 'recipe' is.
As Drupal grows, and this trend towards LEGO-block style customization continues to dominate, a new class of modules to mange these configuration tasks will have to emerge. We've built a few modules like this for our clients - the much-discussed Chris Daughtry site, for example, uses a custom 'Photo Gallery' module to manage some of the settings for Views, CCK, Imagecache, and so on that produce the site's browsable galleries. It doesn't implement much on its own, but it encapsulates some of the more complex configuration code.
Because the module was designed specifically for that site's needs, it makes a lot of assumptions about the environment it'll be running in and doesn't bother with features we knew wouldn't be needed. It's unlikely that that specific module will ever see a public release, but that general approach shows a lot of promise. As we all scurry around building sites with the new tweakable tools, we need to identify ways that our custom solutions can be bundled up and shared with the rest of the community, too...
What challenges have you run into with this new 'more granular' approach to site building with Drupal? What solutions have you found? Sound off, folks. It's brainstorming time!





Comments
Packages and install profiles
Hopefully coming to a Drupal CVS account near you soon, tales have been told of CivicSpace's "packages" concept. Need to add wiki capability to your site, which is a mixture of config (roles, views, settings, etc.) and modules, after the fact? Deploy the wiki "package". /me pokes Kieran and nedjo....
Install profiles are of course the other part of this, but only for fresh, brand new sites. There are some tricks for updating -- e.g. make an install_profile.module that has a schema, and you can put anything you want in the update hooks over time.
In having built a couple of install profiles now, it's clear to me that the concept of packages is needed: I don't want to just cut and paste my TinyMCE config code (which makes up a 1/3rd of my install profile) into install profile number 2. And how about wanting to configure this on an already running site?
profile.pkg and profile.api
Hurrah for the soon to come profile.pkg and profile.api
_glue modules
Spurred on by the Lullabot "Deprecated!" podcast a month or so back, and Nate's comments that the Webform module was probably deprecated and could be replaced by a mixture of CCK and other modules, I thought I'd take a stab at proving him true when faced with creating an online library card application recently.
What I ended up with (quite happily, I may add) was a Library Card Application content type (brought to you via Content module and CCK), a Library Card Applications view (via Views), and an email Action (from the Action module). And to glue everything together, a custom module (librarycard_glue) that used hook_form_alter() to hide the content type's title field and automatically populated the title with the application name and datetime. This custom module also defined an action to be triggered on form submit, notifying a person designated using the Actions UI.
When I embarked, I'd had high hopes that I could eventually develop this module into an all-purpose glue module that others could use to "glue" similar content types into Webform style forms. But upon completion of my implementation, I realized that the amount of configuration burden that's put on the user would make this something of a bear to describe and support. Upon installing this module, a user would still have to:
It seemed to provide too little, while asking so much of the user. Perhaps I'm missing a better way of doing this. I'd love to join forces with someone who has some bright ideas I don't. But at the current time, I think your term "gray zone" describes the scenario perfectly.
mlsamuelson
autonodetitle.module would
autonodetitle.module would have saved you some code. check it out.
Agreed
It's a little bit hard to find, but the actual module name is auto_nodetitle and you can find the project listed as "Automatic Nodetitles" at http://drupal.org/project/auto_nodetitle
Why its not called autonodetitle or auto_node_title, I do not know, but it's Open Source, so these things just sort of happen organically and I have no right to complain. ;-)
yeah... I forgot to mention
I'd meant to mention in my original comment that I'd learned about the auto_nodetitle module after the fact... And it would have saved some code, for sure.
It does beg the question, however, of "how many modules it takes to screw in a lightb- er - create a CCK web form?" though, doesn't it?
Thanks again!
mlsamuelson
I think the CCK/Views
I think the CCK/Views approach lends itself to being incredibly awesome in terms of being able to create content types that are exactly what you want, and displayed exactly how you want them, and with modules like content template, it makes it very straightforward to theme these things, and with imagefield and image cache, it makes setting up REAL simple ways to contribute content for users for a site.
I think Jeff R makes a good point in his saving the world article when he points to applications like Automator being easy to plug legos together to write simple applications.
While it's incredible the amount of power a few CCK modules can give you, sometimes finding out what each of them do can take a long time, (granted not as long as trying to figure it out yourself!), and setting up a test environment specifically to try these configurations can become monotonous, at least until you are familiar with how certain modules interact.
What I enjoy in particular about Automator is that it lowers the bar and welcomes experimentation. Granted you're not constructing content management systems with it, but if at some point down the road there was some method to play with all the different fields at once, or online somewhere, or even with a drag and drop interface, I think it would allow an intermediate or even novice developer to rapidly test different configurations on how content types or views might work.
Another idea could be some way to allow someone with an interesting or useful combination of cck/views related modules to roll that into a glued module to share with others. For example, if someone has a neat content type called "Products" that displayed descriptive text, provided a field for an inline image, maybe some styled subheadings, and a thumbnail thickbox gallery, and relied on: cck, views, imagecache, imagefield, contemplate, and thickbox... maybe if there was another tab for the content type (or a giant red button!) that exported not just the code for the content type, but actually collected all the contrib modules, and allowed that developer to share that "products page with inline image, subheadings, thumbnail thickbox gallery" glue module easily with someone else... well that would be cool, and provide the user installing that module the flexibility to add/remove fields easily so long as they understand cck/views.
Regardless I think the system that is in place currently is excellent and can't wait to see what direction this all takes.
Funny you should say that
Funny you should use "Products" as your example. I did something quite similar for the Übercart project. It automatically adds an image field to the product type complete with imagecache and thickbox galleries. Because it also allows for new product types to be made, the image field is also added to those types automatically.
It's designed to be used in the context of Übercart, so it doesn't have Views integration, though I believe someone is working on that. It's one of the core modules for Übercart, so it doesn't have any dependencies besides CCK and Imagecache.
Data API/CRUD and proper CCK import/export
I know you guys are up on this 'cause I see the 'bots out there in the issue queues for these features, but I thought I'd mention it as what I am running into the most. Especially I see the need to come up with a good solution in core, and then have the same format/technique filter down into contrib, and eventually, I could see it being standard for any module that adds data handling to be required or at least recommended to implement Data API/crud hooks/functions.
Actions in core for D6 is huge, as are the modules out there starting to tie actions and views together. In short order we could have not only the most powerful CMS in terms of presenting content to users, but even building advanced, custom interfaces for users and admins.
Export PHP functions & Visual Documentation
Jeff,
I'm glad to know that I'm not the only one who's felt the exact same sentiment.
I think that there needs to be a range of solutions spanning the range of development backgrounds.
FOR DEVELOPERS
I know that I've had thoughts of wanting to share a combination that I've developed by going through the CCK + Views + MyOwnCustomModule.
I know there are ways to export and import both CCK & Views, but I want to be able to export a CCK + Views setup so that I can plug it into my custom module so then it would just need to be enabled. Maybe a PHP snippet with all of the properly named HOOK_views_blah() functions that could be replaced with MyOwnCustomModuleName_views_blah().
I thought that creating these functions in the custom module code would already be possible, but it sounds like you're article that it's not quite there yet. Or maybe it is, and I just don't know what to name the functions for either views or CCK.
FOR NON-DEVELOPERS
Streamlining the above may eventually solve a lot of issues for the non-developers where modules get enabled and just work. But in the meantime, Drupal's flexibility is making it more and more mysterious to non-programmers. I am still learning the INs an OUTs of views and feel about 50% competent with it's full potential of setting up views and theming them.
I'd love to see a series of Views Documentation blog posts that have some annotated screenshots that connects the dots between the views UI and what Information architecture will be produced from it -- and try to do it with using as little text as possible and let the pictures explain the most common design patterns. Design patterns that the lullabots and others find themselves repeatedly setting up.
The goal should be to send someone to one URL and have them be watch a 5-minute screencast or be able to follow a step-by-step tutorial like this one or see a series of images that helps people move at least past the "I Suck Threshold" and hopefully beyond the "I Kick Ass" threshold. I think it takes a whole lot more frustrating trial and error to slowly move up that learning curve.
What Next?
I had started a Documentation listserv thread to get more visual documentation on Drupal.org, but image hosting issues combined with other drupal.org scalability issues and the multi-step feature request process for getting an image into a handbook page left that effort hanging with a lot of unresolved issues.
My takeaway was that it'd be easier and quicker if these types of visual cookbooks were created on a separate independent blog site. Which site? Either Lullabot.com, Earl's angrydonuts.com or DrupalDojo.com or others. Host the images on someone's flickr or other photo sharing account. And then possibly move the documentation over to Drupal.org when it gets back on its feet again.
I have interest in this because I feel that I'm just enough beyond the "I suck" phase with views but not nearly close to "I kick ass" threshold. And I wish it was quicker and easier to it pick up for myself and others. Drupal is getting more flexible, but more complex.
So if there was a Views experts matched up with some Views novices and beginners (i.e. Drupal Dojo), then I think some good stuff could come out of. I know the developers of the Mac screencapture program called Skitch, and I may be able to get some more copies of this private beta software to some folks interested in helping with this type of Drupal documentation.
Thoughts?
CCK node types can be generated from *.install profiles
I just saw that CCK node types can now be generated programatically, which seems to be moving a step closer towards automating the use of custom node types within custom modules.
CCK plus Views presets could be superior to modules
After listening to the Deprecated podcast I did start to worry that Drupal would become less powerful for me, as a nonprogramming site admin, because developers would stop creating fully-featured modules.
BUT!
If someone could pass me CCK and Views "presets," this could be superior to modules. Not only would it help me get something up and running, but being able to see and tinker with the fields and how they are viewed could be a real learning experience, and allow someone like me much greater ability to customize than modules currently do.
It also opens the door to letting nonprogrammers help the community more. What if a nonprogrammer takes a set of presets and makes some really useful changes to, say, the view, and re-contributes that? Previously, a nonprogrammer couldn't really make a meaningful contribution to a module's functionality.
I don't know if passing such presets is possible. Is it?
Post new comment