|
|
|
|
|
|
Submitted by jhuckabee on Sat, 12/15/2007 - 19:26
|
There are some very trivial administration tasks that I find myself doing over and over again in Drupal which can't currently be done from the admin interface. As of right now, these include installing a theme or module from drupal.org or adding a new site to an existing Drupal install. So, I've built a tiny Capistrano file that allows me to automate these tasks.
The tasks that I've setup are:
cap drupal:install:theme
cap drupal:install:module
cap drupal:install:site
cap drupal:install:theme
All this task requires is a path to the tar file of the theme that you want to install. What I do is browse over to the list of Drupal themes, find one that I want to try out, and copy the location of the "Download" link for the correct theme. In Firefox and Safari its as simple as right clicking the link and selecting "Copy Link Location". Make sure the version of the theme corresponds to the version of Drupal you have installed.
Once you've got the location to your theme copied, run the task with cap drupal:install:theme. It will ask you for the path to the theme location which you can then paste in. That's it. You should be able to browse to admin/build/themes and see your newly installed theme.
|
|
|
|
|
|
|
|
|
|
Submitted by jhuckabee on Thu, 12/13/2007 - 02:43
|
In a previous post I showed how to get around a bug in Prototype that was ignoring the "on" parameter of the observe_field function. The solution I originally posted no longer works with the latest version of Rails and Prototype. Although the documentation for observe_field received a facelift, somehow the Rails team still missed the fact that the :on function doesn't work with the current version of Prototype. Or maybe its the Prototype guys we should be after here. :-)
The new fix requires a change to both prototype.js and a small Rails core update.
I will start with the update to prototype.js. Search for Abstract.EventObserver (around line 3632 in my version). That should now read
Abstract.EventObserver = Class.create({
initialize: function(element, callback, trigger) {
this.element = $(element);
this.callback = callback;
this.trigger = trigger;
this.lastValue = this.getValue();
if (this.element.tagName.toLowerCase() == 'form')
this.registerFormCallbacks();
else
this.registerCallback(this.element, this.trigger);
},
onElementEvent: function() {
var value = this.getValue();
if (this.lastValue != value) {
this.callback(this.element, value);
this.lastValue = value;
}
},
registerFormCallbacks: function() {
|
|
|
|
|
|
|
|
|
|
Submitted by jhuckabee on Mon, 12/03/2007 - 13:25
|
Because I'm a fan of both Ruby on Rails and Drupal (yes, Drupal uses PHP), I get a surprising number of visits to my website each day from Google searches that include some combination of the two as keywords. I find this strange because if you know either of the two, you know that they're in two totally separate worlds.
Drupal doesn't expose any kind of API (besides RSS feeds) that Rails could take advantage of, nor does it make sense to create one.
Since Drupal uses PHP, you can't create module for it in Rails. The only way I could possibly think to marry the two would be to create a module that simply puts an iframe on the page and loads it with your Rails app. In fact, it doesn't even have to be a module. It could be a simple page you create with an iframe pointing to your Rails app.
But why in the hell would anyone want to do this? I guess I'm a little short sighted on this issue right now as its hard to see where the two would play nicely with each other, or why you would want them to. If you want to extend Drupal, use PHP. If you want to use Rails, look at Mephisto or Radiant CMS and extend either of those.
|
|
|
|
|
|
|
|
|
|
Submitted by jhuckabee on Sat, 12/01/2007 - 16:30
|
After several years of tinkering with my Drupal deployment stack, I've finally found one that I think is both stable and performant. There is usually a trade-off between the two, but not anymore.
Debian Setup
My stack starts with the latest version of Debian Etch. Both Slicehost and RimuHosting provide these as an OS choice for their VPS plans.
Now, some people will only use packages from the stable repositories on Debian. If you're one of those people, you can still follow the majority of this tutorial. However, you will need to skip the part about updating sources.list and you also won't be able to install the php5-xcache package using apt (as of this post its still only available in test). You will still be able to download and build XCache from source, but I won't be going over that here.
From my own experience, I've found that the packages in test are "stable enough". Of the small bugs that do get into test, I haven't ran into them, nor (as of this post) are there any bugs in test that effect the packages we'll be installing here.
So, first thing we'll do is edit our sources.list file to include the testing repository if you haven't already done so.
nano /etc/apt/sources.list
|
|
|
|
|
|
|
|
|
|
Submitted by jhuckabee on Wed, 11/28/2007 - 04:20
|
There have been several requests on the Ubercart forums for a Google Base feed of the products in a store. I first attempted to do this using Views and the Views RSS modules, but due to some of the custom required fields it wasn't doable.
However, it was very simple to wrap up into a small contrib module for Ubercart which I've uploaded here.
The module allows you to customize the feed title, link, and description via its settings form. It includes all taxonomy terms for a product in the product_type field and uses the first product image for the image link.
Please direct all comments, suggestions, and critiques to the contrib page.
Ubercart is a highly customizable e-commerce package for Drupal with a very bright future.
|
|
|
|
|
|
|
|
|
|
Submitted by jhuckabee on Sat, 11/17/2007 - 18:49
|
One of the projects I'm currently working on uses ActiveReload's LightHouse application for bug tracking. Its a fairly straightforward web application written in Ruby on Rails that sells itself as "Simple to the bone" bug tracking.
This week I was tasked with working on several bugs and went into Lighthouse, ticket number in hand, ready to get started. Once I log in, I navigated to the "Tickets" page and the search form I'm presented with looks like this...

My first inclination was to put the ticket number right into the search box. No go. That didn't work, so I checked out the dropdown to the right of the search box with no sticking out at me. I then moved on to the "help" link at the end of the form where I learned they provide some pretty cool ways to search tickets... by tags, milestone, status, and even provide natural language date-based searched such as "5 days ago" or "since 1 week ago". All of these you can combine to form fairly complex searches. However, I still couldn't find a way to put in a simple ticket number and find my ticket.
|
|
|
|
|
|
|
|
|
|
Submitted by jhuckabee on Wed, 11/14/2007 - 03:38
|
I've been asked by several friends lately, "How do I create my own website?". Instead of offering to do it for them, like I usually do, I thought I would write up a quick guide to point them to.
As someone who's been doing web development for a quite a while, its easy to take the basics for granted. However, I remember what it was like trying to piece everything together to make my first website, circa 1995. The fundamentals haven't changed much since then, but the tools (and connection speeds) have come a LONG way.
On with the guide...
Since you're still reading, I'm assuming you know basically nothing, or very little, about how the internals of the world wide web work. It may seem a bit foreign at first, but its really very simple.
|
|
|
|
|
|
|
|
|
|
Submitted by jhuckabee on Mon, 11/05/2007 - 14:43
|
In a previous post I raved about the service and support I receive from RimuHosting and their VPS plans. Their service remains unmatched, but I've been using another hosting provider for some other projects that is also very good.
SliceHost.com has been around for maybe a year now. It was quite the buzz when it came out - and apparently is still since setting up one of their VPS plans requires you to wait for up to several months on a waiting list.
What I like about SliceHost is that everything I normally contact RimuHosting to do for me, I can do myself via SliceHost's admin interface. This mainly involves adding RAM or, since I do a lot of playing around on my slices, reinstalling a clean OS. For instance, yesterday, I wanted a fresh start on my RimuHosting VPS with the latest version of Debian. So, after backing up some databases, I submitted a support ticket and it was done. I'm still hugely impressed that I receive responses from RimuHosting within 5 minutes of me sending an email. And, after I confirmed what I wanted to do, it was another 5 minutes before my VPS was entirely rebuilt.
|
|
|
|
|
|
|
|
|
|
Submitted by jhuckabee on Thu, 05/31/2007 - 04:02
|
I just finished a project for a friend using Mephisto. I wrote a custom plugin to handle online submittals of appraisal orders that includes an entire admin interface to manage all the drop down boxes you see. The module stores appraisal submittals so you can see them in the admin interface and re-assign them to different appraisers or update their status etc. The module also autmatically emails a copy of the appraisal to the selected appraiser on submission. Its a very targeted module, so I don't plan to release it, but if anyone is interested in the code, I'd be happy to share it. Just shoot me an email.
Working with the Mephisto plugin system was fun and very easy to do. For anyone looking to extend Mephisto through its plugin system, I highly recommend just grabbing an existing module and dissecting its contents as the documentation isn't quite complete.
The new site is being hosted by HostingRails.com. I've been very impressed with the performance so far, and the little support I've required has been handled very quickly. They get a nods up from me for anyone looking for a shared "Ruby on Rails" hosting provider.
|
|
|
|
|
|
|
|
|
|
Submitted by jhuckabee on Thu, 05/24/2007 - 21:19
|
I've finally gotten around to creating the 5.x release of the OpenID URL module for Drupal. Check it out!
I actually got to meet some of the guys at JanRain (the company that actually started the OpenID initiative) at RailsConf in Portland. They were demoing their latest OpenID consuming application Pibb which is looking very cool! Email/IM/Chat app rolled into one and built in Rails.
|
|
|
|
|
|
|