* Revisions, Previews and Sunblock
Posted on July 25th, 2008 by Phil. Filed under Drupal, Preview, Television, Testing.
Apologies to all of our loyal readers who were disappointed by the lack of a post last week (that’s you mom!). See, I was on a family vacation at an undisclosed location working on my farmers tan and spending just about every last cent we had in the bank to entertain the wife and kids.
It was a good time that unfortunately had to end, so now this week I’ve been back at it, closing in on the launch of our new TV Programs and Schedules module. Whilst I was gone Pete was busy fielding bug reports and questions from our testing team. The good news is there seem to be relatively few actual bugs. The code is pretty solid and we are plowing forward getting the production environment ship shape in preparation for launch!
However, that does not mean we are without issues.
One issue that I knew would come up eventually has already come to the surface, a bit earlier than I had figured on. It has do with modifying published content and previewing pages that contain information from multiple nodes, like our episode pages, for example.
See, our current site and CMS have lots of flaws and unsightly blemishes, but one thing it is good at is allowing content producers (CPs) to create multiple revisions of a page or content item, publish one revision and continue to tweak the content without overwriting the published version until the appropriate time. Also, our current site has very sophisticated previewing functionality, allowing CPs to preview just about any given page to see unpublished changes, including the ability to preview by date, showing what the page will look like at a future date, based on scheduled publish and expiration dates for content items.
Know what I mean?
Drupal, natively, doesn’t seem to do either of these things particularly well. Or, if it does, I still haven’t figured it out. Oh sure, you can configure content types to allow multiple revisions, but all that really does is archive earlier revisions of a node, in case you want to roll back later. That’s good, don’t get me wrong, but what we need is the ability to publish a revision, then create a new revision that isn’t published until we say so. We can sort of use the current functionality to do this. You could publish a node, update it and create a new revision (which immediately publishes the new revision), then revert back to the original revision and roll it forward when we want the new revision to be live. However (a) that’s an annoying number of steps and (b) you can only edit the currently published revision. Not so useful.
I recently played with the Revision Moderation module, which gets us closer to what we need. Basically, that module will create a new revision for you without publishing it until a user with the proper permissions chooses to. However, we’ve decided not to implement it now because the code for Drupal 6 isn’t even in alpha state yet and also because there seem to be issues with one user seeing the unpublished revision created by another user, etc. etc.
As for previewing, our new episode pages are fairly complex and draw on content from multiple nodes and content types (e.g. program descriptions, episode info, related content boxes, etc.). The problem they’re having is that they need to modify some pieces of content on a published episode page and, in doing so, need the ability to preview their work in the context of the page in order to get the layouts right. Right now there is no easy way to do that. The preview functionality provided by Drupal on the node edit pages is fine, but it doesn’t allow CPs to preview, say, right hand rail content boxes in the full context of an episode page.
What we really need is the ability to look at a published page and pass in a preview flag, which would then display the latest (potentially unpublished) revisions of the nodes on the page. Even better, this preview functionality should allow for a date parameter, which would then also take account of Scheduler publish and expiration dates.
Now tell me that that wouldn’t be sweet!
Anyhow, I knew this would be an issue sooner or later, but chose to put off dealing with it for the TV Programs and Schedules module. However, as we look to rebuild the whole rest of the WGBH.org and move everything to Drupal, we will have to come up with a better solution. In the future, our home page will be made up of view lists of content boxes, each of which could have its own publish and expiration date, multiple revisions, etc. Being able to properly preview the page will be key for us…
Any ideas? Let’s hear em.
4 Responses to “Revisions, Previews and Sunblock”
Leave a Reply
You must be logged in to post a comment.
Archives:
- February 2009
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
Categories:
- Apache
- Architecture
- Boost
- caching
- CCK
- CMS
- cron
- CVS
- database
- Date
- Devel
- Drupal
- Drupalcon
- FeedAPI
- Flickr
- Image Assist
- Images
- Install Profiles
- MacBook
- Memcache
- MySQL
- NPR
- Pathauto
- PBS
- PHP
- Preview
- Protrack
- Public Media
- search
- Social Media
- SQL
- SVN
- tags
- Television
- Testing
- theme
- TinyMCE
- Token
- Tools
- TV Guide
- Uncategorized
- Views
- WordPress
Disclaimer
- The opinions expressed in here are those of the writers/contributors and do not necessarily represent the views or opinions of the WGBH Educational Foundation.











July 25th, 2008 at 10:59 pm
You are facing the same issues as we are. In fact the comments about Revision Moderation for 6 are the result of a discussion I had with webchick a while ago. I still haven’t found any time to work on it:(
Previews, staging and block management are my top three Drupal wishes for 6 at the moment. Once you have more than 15 blocks on the site handling them becomes a major pain.
July 26th, 2008 at 7:23 am
I don’t know of any perfectly clean way to solve this. Perhaps you add some PHP to the major node so that it loads the very latest version of each node if an admin passes a special querystring param. Something like.
if (user_access(’administer nodes’) && $_GET['latest'] = ‘y’) {
$revisions = node_revision_list();
$node1 = node_load(12, key($revisions[0)); // this is for D6
}
else {
$node1 = node_load(12);
}
April 11th, 2009 at 10:43 am
The *clean* way to do that requires 2 separate facilities:
You need the start date/end date versioning stuff, and the ability to see what the site will look like on a given date, using the *approved* versions of each element.
But you also need the ability to have different developer each pinch off their own version of the site, and see how that looks as they work on it, invisibly to both public viewers, and privileged viewers who are looking at a future (or, I might point out, past) dated view… only those people who log into an “SVN tagged” view of the site see those changes; this way you can salvo large changes site wide for testing.
All of this stuff lands in whatever piece of code does object-call dispatching, as that’s the only obvious centralized place to get it accomplished.
It also requires that you don’t short cut anything — notably, any context you choose not to place directly in the versioning system has to be stored in a versioned fashion as well; CSS and media files are the likely culprits.
WebGUI does a lot of this stuff, and I think Zope does as well. I don’t know about Django. One’s perl and the other two Python, so if your team is married to PHP, they’d be a hill to climb…
April 11th, 2009 at 11:01 am
One other observation: that approach lets you version modules which *read* databases which are not under the control of the CMS proper… but it doesn’t handle writing them, or schema versioning.
Doing it completely properly requires that any DBMS storage *be under the control of* the CMS and versioning engine. That takes you into Zope or possibly even Frontier territory.
Frontier’s beautiful; shame the Linux port stalled.
Wanna start a development project?