Drupal has a Taxonomy module for categorizing content. The module can generate a select box based on the defined taxonomy. However, it does not support option groups. I figured I’d share my modification for those who’d like to do the same. It was based on code from a Drupal forum post which I think was based on Drupal 5, not 6.
Archive for the ‘Programming’ Category
So I had to move an application that I’m developing from a MediaTemple (dv) Dedicated-Virtual to a Ruby on Rails GridContainer running on a MediaTemple (gs) Grid-Service. Most of the tutorials I found that covered installing a Rails app on a GridContainer were somewhat dated. Things that were different than expected include:
- Rails, a few precompiled gems (like RMagick), and a test app are automatically installed for you. Most of the tutorials walk you through installing Rails and the skeleton app from SSH. That’s no longer necessary.
- For Capistrano, you need to set the
syspathoption (“System” in the control panel) to/home/[xxxxx]/containers/rails/[app_path]/currentwhere [xxxxx] is your GridContainer number and [app_path] is where you want your app located. I kept the app path and app name the same. - You can’t edit application options from the web control panel. You have to do this from a SSH session using
mtr set_option. You may need to do this to change thesyspathor to set theenvironment. For example, to set the environment to “staging” you use the following command:mtr set_option [app_name] environment=staging. - If you change the
syspathmake sure to update the symbolic link to the app’s public folder under your app’s domain, otherwise you’ll get an app not found error. In other words,~/domains/example.com/htmlshould point to/home/[xxxxx]/containers/rails/[app_path]/current/public. - When an application fails to start, you get no feedback about the cause. Check log/mongrel.log for details as to why your application fails to start.
- After changing the
syspath, the app may not restart. You may get anAddress already in use - bind(2) (Errno::EADDRINUSE). To resolve this, I ended up having to reboot the container. - For some reason,
rake gems:installdidn’t work. I had to manually install each gem.
I definitely had a lot more control over the installation when I had the application running on the (dv) using Passenger Phusion, especially having the ability to compile software. However, the GridContainer runs a lot faster.
Getting CSS rules to work across all browsers is a continuous fight. Thankfully, there are workarounds and DHTML methods to correct many of these problems, and if those fail, reluctantly there are hacks available. Unfortunately, it seems I’ve run into a difference of opinion between the browsers, most likely as a result of the W3 Consortium failing (yet again) to be explicit with their standards. The problem is the difference between the way Firefox and Opera interpret the “word-spacing” CSS property versus the way Safari and IE interpret the property. More specifically each browser treats the non-breaking space differently. FF/Opera both respect the non-breaking space and Safari/IE both ignore the space. For example, if the text is “first foo bar last”, FF/Opera would like:
first foo bar last
whereas in Safari/IE the text would appear like:
first foo bar last
Personally, I agree with the FF/Opera developers and feel that the non-breaking space should be respected since I’m explicitly telling the browser that words to either side of the non-breaking space should be treated as a unit. So now I’m going to have to put each phrase in some sort of HTML block and depend on a combination of padding and margins to accomplish the same effect in order for it to be cross-browser compatible.
Restyle Google Calendar 4
Posted December 4th, 2008 in Programming / 134 CommentsTags: CSS, Google, Hacking, JavaScript, PHP, Programming
As a few users of MyGoogleCal3 have already pointed out, the script no longer works properly. That’s the bad news. The good news is version 4 does work. In fact, with the latest changes Google made to their code, ALL the features that were broken in 3 appear to be working now—Agenda/Week view, the calendar navigation buttons, and IE is fixed. Please download and test out the latest version, and report any bugs in the comments and I’ll try to resolve them as time allows.