Archive for the 'how-tos' Category

Drupal’s Feed API

I’m at DrupalCon Boston.  Well, actually, no, I’m at a friend’s house with tea because I came down sick today and couldn’t make it back to the convention center.  And while there are a ton of things I want to report back on (Dries “State of Drupal” speech, Boris Mann’s scoping web projects for Drupal talk, etc etc) I thought I’d point to something smaller and simpler first.

Yesterday my friend in the education world, Bill Fitzgerald of DrupalEd and OpenAcademic, showed me his implementation of Feed API.  If you don’t want the discussion of where it came from, just skip ahead to the next paragraph for the functionality discussion.  I had talked to Bill before about the challenges at schools of using a local server for student portfolio work (with DrupalEd, for example), and having a public-facing school site hosted on an ISP - a setup most schools have right now.  What was the best practice for getting approved student portfolio work published on the main, public-facing schools website?  Using an RSS feed seemed to be a good idea, but I was worried about a) the feed not pulling in the data permanently, just as temporary RSS data, so old posts would fade out as it were on the feed, b)
the elegance of feeding multi-field and multi-media feeds.  (I tried out Leech last year, but the second issue above was a problem for me).

Bill’s implementation of FeedAPI is superb, thanks in part (as he acknowledges) to the Feed API team.  The OpenAcademic feed site pulls in the full text (and images and video - and authors, and tags) of several eduction-related blogs.  Not only that, but it also creates a tag cloud of imported tags too, including author names.  There are several more things going on here - read about how it was implemented here.

Technorati Tags: , , , ,

Drupal User’s Guide - an update

I get a ton of hits on this site, just because I use the keyword Drupal.  (“Drupal.  Drupal!  Drupaldrupaldrupal!”)  One of the most consistently hit blog entries is my (old) Drupal User’s Guide, for Drupal 4.7.  Of course, I had grand ideas of updating it, and today I even began looking at the powerpoint I had developed to begin that process.

And I buckled.  There’s just so much more basic setup info in Drupal 5.  (And we’re already moving on to on Drupal 6!)

But here’s the good news - there’s a Drupal 5 Cookbook (for beginners) on the Drupal website.  It’s much more recent than my user’s guide.  And as sad as I will be to say goodbye to all the hits I got off my User’s Guide post, maybe I’ll make up for them with this post….

(”Yeah, good luck with that….”)

Powered by ScribeFire.

Dupal micro case study: Implementing change in modules

I was digging around for a solution to supporessing the iCal link in the Events block. You know, that little icon that supposdly lets you automatcially add those events to your hCal capable calendar, but has never seemed to work for anyone I know? :-(

I looked online at Drupal.org, and found this interesting thread. What made it so interesting for me was that the thread offered several solutions for fixing this, and in doing so made a case for how to - and how not to - make changes in Drupal:

  • The first suggestion was to edit a couple of lines of the actual module. No! No! NO!….. What happens when you upgrade the module - or worse, the site? You gotta edit your module again! IT’s repeated everywhere on Drupal forums - don’t edit the module when you can override it somewhere else!
  • The second suggestion was to make a modification in the theme. I like that better - themes are independent of module revisions. For all I know, this is perfectly legitimate according to the Drupal Best Practice Gods.
  • However, the last suggestion was perfect for me. A) It’s much simpler than the theme override. B) It only requires editing the style.css file, which requires less expertise.  (I would recommend that over the event.css file, which could get replaced in a module upgrade).

However, I don’t know what are the underlying implications of removing the ical icon on the theme or css level - i.e. is the underlying code less “validatable” in the last example? From my (poor) understanding of how Drupal will produce the code, the page will still be created with the ical code info, but the icon just not displayed - so there’s a (tiny) amount of unecessary work that is being done on the page rendering side, which may be improved with the theme modification in the 2nd example…..

Technorati Tags:

Powered by ScribeFire.

Awesome drupal case study - for online newspapers

Information.dk - a Danish newspaper that relaunched on Drupal - published their production case study on Drupal.org - from architecture design to CSS challenges…

Wow - I wish all case studies were like this.  This is yet another way to give back to the community.  I’ve rarely read a case study where I actually learned so much.

I found this while digging around for info about Drupal newspaper sites for a friend.  There’s a newspaper group, and from there I discovered that there are a bunch of Drupal newspaper sites
 (including internationally) in production.  Including America’s Finest New Source, natch.

Technorati Tags: , ,

Powered by ScribeFire.

Renting a car in France

I’m planning on returning to France in November, and was looking over some of my travel notes. I realized I had not finished my “France travel-tips” triptych - car rentals in France.

There are a couple of things to consider when renting a car, and my recommendation for a car rental agency:

Insurance:

  • As in the US, car rental agencies make most of their money off the insurance they tack on at the counter. In France you are usually charged for car damage “CDW” and / loss “LDW” (I think they are referred to this way, even in France). There is usually a theft insurance too..
  • Used to be that you could avoid the (astronomical) additional daily insurance charges by using a credit card that would provide insurance instead. However, many places I’ve visited in the last couple of years have wised up to this tactic. Usually what happens is you’ll see a price listed for a car - let’s say 20 Euros a day. OK, you figure you’ll avoid the additional 30 Euros a day of insurance (maybe that’s an exaggeration) by using your credit card….. Ooooh no. That 20 Euros a day is their promotional rate, when you accept the insurance they provide. Otherwise, the price jumps up….


Manual vs. automatic:

  • If you’re like me (sadly), you don’t know how to drive stick. Well, you’re gonna have to find a place that rents automatics. A lot of the bigger agencies (Avis, Hertz, EuropCar, etc) can provide an automatic, in the larger cities and at airports. However… there are “horror” stories of getting there, and the previous renter of their single automatic in the entire fleet has still not returned the car, and you’re out of luck.
  • You could try out AutoEurope, a 3rd party rental broker, which can guarantee you an automatic - depending on the metropolitan region, and guarantee you a price. A lot of Americans like this service because you can call an 800# from the US and set up your reservation; and when you’re done, you know what you’re paying. However, you’re paying the price for these guarantees - i.e. roughly a 30% premium.

Diesel vs petrol:

  • Unlike war-subsidized oil prices in the U.S. ;-) France does not subsidize gas prices. When you see gas at about 1.3 Euros, that’s PER LITRE (multiply by 4 to get a rough gallon price). Yeah, driving costs money, don’t it? That’s a fact the rest of the world is much more intimately familiar with than we are.
  • So your best bet is to rent a diesel if you can. Diesel is about the same price - but are far more efficient (i.e. you’ll be refueling about 1/3 to 1/2 less often).
  • Unfortunately, getting an automatic diesel is like finding a car rental place open during lunch - not impossible, but very difficult. (Remember that when you schedule your car return to coincide with that noon train!)

What I do when I’m in France:
I use UCar

Insurance: The UCar agencies specialize in having a published, inexpensive rate including CDW/LDW insurance (your liability is 500 Euro damages and 1000 Euro theft - not great….). They have big charts in their offices that will show you the exact price you’ll pay, for a certain car, for a certain number of days. When you come back with your car, you leave with that exact amount charged on your credit card (i.e. they don’t send you a racked up bill later). It’s that simple - I’ve done it several times now.

NOTE - A lot of the UCar rates include a specific mileage limitation. This makes it ideal for local exploring, but a bit more expensive for trekking across the country. Their miles are nonetheless pretty generous.

Locations: UCar agencies are everywhere - there’ll usually be a couple in a good-sized town, and then a few more scattered along the villages outside of town. However, these UCar locations are invariably in the middle of friggin’ nowhere. For example, the UCar spot in Avignon is several kilometres outside of the quaint central part of town - you have to take a bus into the Avignon “banlieue” to get there.

Automatics: This gets a little tricky, and again it’s very helpful to be able to speak French. I called the toll number and said I was looking for an automatic in a particular region. The central reservation place in turn called the local agencies to find who had an automatic, and called me back with a reservation. Awesome. Except I needed to enlist the help of another driver with car to get me to that location. (In this example, the Aix-en-Provence UCar is in the commercial section a good dozen kliks outside of town. Yes, you can take a bus, but come on! The best thing about it is there is a great organic store and outdoor restaurant around the corner form the Aix UCar place).

Of course, if you don’t speak French, it’s harder. If you don’t have a cell phone to call back, it’s even harder (I will try to call form the US for this next trip, and see how we can work out the call-back for the reservation).

Nonetheless, one of the great things about UCar is that they all seem to be local owners, and many will get to lengths to help you out (the guy in Avignon drove us to the train station because it was his lunch time, and we were running late).

Technorati Tags: , , , ,

Powered by ScribeFire.

More Drupal fixes: Node profile, TinyMCE themes, LDAP blank page fix, and funky node permissions

Significant Node Profile update: [2008 Update - the links below don't work, try this.] Node profile is a module (a series, in fact) that allows you to manage users as nodes - as opposed to the separate node type they currently are. If you’ve ever wanted to add a taxonomy to user profiles, you’ve encountered the problem that node profile tries to address. I tried node profile in Jan, and got just so far before quitting. The reason? If you’ve played with earlier versions of node profile, you know that it puts the basic account info (account name, email, password) in one area, and all the rest of your profile info in another - and there was no graceful way of presenting a user with tabs to edit either part without hacking out some code - and I am code averse. ;-) That is, until they released an updated tutorial - the key is to download the zip file attached to the page, which includes the tutorial and the node profile bonus pack. Oh- and then follow the instructions. Note: We used the version of the tutorial I linked previously - they have yet another newer version. (Big up to Michelle, who did the bulk of this work while pregnant; thanks to Roel for prompting me to look at this again).

TinyMCE theme buggery: If your TinyMCE looks all funny, and you are trying to figure out why, it’s likely because you’ve chosen to use the site theme as opposed to the TinyMCE theme. I’ve had little luck using a site theme that will reliably show me what my content will look like in the TinyMCE edit window. I know the same is true for the basic TinyMCE theme - but at least that’s consistent, and I know what will change when I publish…. The little setting you are looking for is in the TinyMCE settings page, under CSS at the very bottom.

LDAP Blank page error: I had installed the LDAP module on an in-house server for one of my projects (a windows server with Apache2Triad installed). We kept getting a blank page every time we tried to log in using an LDAP account - and we double-checked all our settings. Turns out, we had to enable the LDAP extension in the PHP.ini file - which we were able to do through the Apache2Triad interface. I don’t remember the exact line or setting - but it was obvious to me, and I’ve never looked at a PHP.ini file before….

Node edit lockout / filters permissions: On another project, the site maintainer kept telling me they could not edit a story node that I knew they had permission to edit. They could edit other story nodes, but not a few particular ones. It turns out that I - as the admin - had changed the input filter on the particular node (to get around re-editing some image html). However, the site maintainer did not have input filter permissions - and once I changed the input filter it locked the entire node so she could no longer edit it.

Orphaned “You can’t post comments” text:
I was noticing this bit of text at the bottom of some posts, when I knew that comments had been turned off for the entire site. It took a while to figure out that these were nodes that had been added before I turned off comments, and so the individual node still had comment permissions turned on. More feedback on this here (see comment #5).

Technorati Tags:

powered by performancing firefox

Train travel in France

First things first - if you can speak French (or at least understand it well enough) DO NOT use RailEurope for any point-to-point train ticket purchases (they are still the only place to buy EurRail passes).  For example, I was looking for a ticket from Paris to Macon:

  • SNCF / TGV site:  I found a 1.5 hour TGV ticket for 50 Euros.
  • RailEurope:  I found a 4 hour train ride, no TGV, with a transfer, for $120 (about 80 Euros).

You can purchase TGV tickets (or even regular non-TGV train tickets) from the SNCF site, from any point to any point (even the smallest station).  There is a small question at the end of the form that asks your country of residence.  If you say the US, you get punted to RailEurope; however, you can say France - and then select the option to print out your ticket yourself.  International credit cards work fine on the site.

A couple of other things to note:

  • DON’T select any ticket that only allows for a ticket retrieval from a “borne automatique” - a ticket machine.  These require you use your purchasing credit card to retrieve your ticket- and if you’ve spent any time in France, you’ll know that almost every “credit card” machine actually requires the French credit card with the embedded chip (I’ve seen foreign cards - chip and all - fail in these systems too).
  • You can, in general, retrieve your ticket from a human being - just be sure to give yourself enoguh time to stand in lime.  And keep handy the confirmation code number they send you via email.  They can’t do anything about your ticket without it.  I missed a train (see “credit card without chip” above) and had to get re-routed - the agent could not look up my info based on my card nor my name.
  • When you buy a ticket from a human, remember that the train system pricing depends on a rather complicated set of peak and off-peak times that can radically affect the price - and they won’t necessarily offer you the cheapest ticket unless you ask.  They tend to ask when you want to go, and then give you a standardized price based on that time of day and day of week (and season, etc).
  • For what it’s worth - mobile phone use within the cabin is strongly frowned upon.  That’s what those cute stickers of sleeping cell phones all over the cabin mean (go to the area by the bathrooms and exit doors for a phone conversation).

Technorati Tags: , ,

powered by performancing firefox

Mobile phone and SIM card experience in France

[UPDATED 2007-08-17, and read the comments for more info] I expressly bought a triple-band Nokia mobile phone so I could travel to France and use it. The idea was that in the US, I have a regular subscriber account, and the SIM card I have in my phone essentially identifies me and my account. No need to change it, renew it, whatever.

When I landed in France, my phone immediately picked up Orange as the local provider (since it has an agreement with T-Mobile, my US provider). So in an emergency, I could already make a phone call (I forget the rates now, but it’s something above $1/ minute). Instead, what I had planned was to swap out my T-Mobile user account with a basic pre-paid SIM card - the type that you can buy for a certain amount, and you get up to that many minutes. Since I had never done this before, I had a few stutter steps in the process, and I’m listing my “learnings” below:

  • The three main mobile services in France are Orange, Bouygues and SFR (there are others).
  • You can go into any mobile sales center (of any of these services, or an independent shop that sells all of them), and buy a pre-paid SIM card. You get a phone number when you buy the card, and it works immediately. I got an Orange card that cost about 14 Euros for the card, and included about 5 Euros of time - which is only about 15 minutes (turns out my 19 Euro fee was based on a promotional deal - usually the combo can be 30 Euros or more - see below). You can add minutes to this card - but I’m not positive you can add minutes later easily (see below).
  • You can go into almost any bar-tabac or magazine store and buy minutes - for any service (e.g. Orange, Bouygues, SFR). What you get is a receipt with a code and phone number to set up your minutes. However, that’s only usable if you have a SIM card for that service already - even if you’ve run out of minutes on that card. However, these new minutes will change your phone number. Also - I learned the hard way - if you get it wrong (i.e. you don’t tell them the correct service) it is absolutely non-refundable (since you get a secret code number printed directly on the receipt).
  • I was looking for an Orange card, because … well, because that’s what I knew. So I was rather put out that 1) I was standing in front of Gare de Lyon - one of the busiest train stations in the world - and saw no signal (although my phone did work), 2) over 60% of the time I was on the train, going from Paris east to Geneva, I had no visible signal - even though everyone around me had a signal. Apparently, Orange’s network is not the greatest (is my personal experience) my phone sucks. It wasn’t a matter of poor network - my phone picked up other networks on various occasions. I think it has more to do with the fact that I did not have a fancy enough phone (i.e. I only had one of the working bands for France, and not both. Maybe I shoulda splurged for the 4-band phone…)
  • I was not able to send a text message right away. However, after a off-on cycle, it worked fine. (International SMSs never worked…)
  • For what it’s worth, when you are calling inside the country, most numbers in France start with a 0. (I.e. drop the country code (33) and add the zero.)

Technorati Tags: , , , , , ,

powered by performancing firefox

More Drupal quirks: TinyMCE folder permissions; multiple-select profile patch

(All these solutions are for Drupal 5.1)

TinyMCE folder permissions problem:  This is not a problem with roles or user permissions - although the symptoms are similar. The giveaway fro my problem was the following:

  • In the TinyMCE settings page, the button icons had disappeared.  I had all of the TinyMCE configuration settings available, but the little icons for the editing / formatting buttons would not display.
  • In any text editing window that was supposed to display a TinyMCE editor pane, I would see “disable rich text editor” - but there *was* no rich text editor.

I finally tracked the problem down to a server folder permissions error.  Since this happened to me twice (and damn if I could remember how I fixed it the first time), I can only guess it’s a problem either with my ISP, or with the TinyMCE application. And I mean the Moxiecode app, not the Drupal module.

In my TinyMCE folder, the second nested TinyMCE folder (the one I downloaded from Moxiecode) had permissions set to 664 or something - in effect, the Drupal app could not access it.  All the nested folders beneath that one had 777 permissions (i.e. full access for everyone).  I changed the nested tinymce/tinymce folder to 777 as well, and it worked.

Multiple select patch for the profile module:  I’m using the profile module for users to select what languages they speak.  (I won’t get into the discussion of whether that list should be in native language, English, or both, etc….).  In any case, I want the users to be able to select more than one option - from a pre-determined list….  The one option that is not available out of the box on the profile module.

Again, took me yonks to find this - then I forgot where I found it when I needed it again (and had deleted my original install).  So here it is for eternity (well, on my Del.icio.us links too) - multiple-select patch for profile module.

(And a primer on patching in Drupal).

Technorati Tags:

powered by performancing firefox

Getting around Drupal’s Clean URLs

A friend of mine’s site was hosed (that grammatical construction is terrible, but moving on….) - her domain expired and we were trying to work on it while she got her domain back online.  We got the URL alias from her hosting company, but predictably could only get the front page - none of the links would work.  No problem - we edited the settings.php to change the base URL.  Except that didn’t solve the problem - we still got error messages.

I finally figured out that the culprit was the Clean URL setting - I could get to the various pages if I used the domain.com/?q=pagename format.  But I couldn’t log in with Clean URLS - it would boot me to a page that didn’t exist.  Until I found this clue buried in a Drual thread:

Put this line of code (anywhere) in your settings.php file:

$conf['clean_url'] = 0;

That fixed it - it actually disabled Clean URLs in the settings page.  (We just need to remember to remove this when we get our domain back).

Technorati Tags:

powered by performancing firefox

Next Page »