Fixing my Dave Atkinson Problem

Peter Rukavina

Friend Dave Atkinson sent a helpful note this morning:

I love getting your blog delivered to my inbox, but I note that something in the process makes photos not appear. Error messages on everything but the header.

I checked, and Dave was right: people subscribing to my posts by email have been seeing broken images in most situations. I set out to fix that (friends like Dave don’t come along every day).

The source of the problem was that, in the HTML of the body of my posts, I was inserting images like this:

/sites/ruk.ca/files/onetweet.jpg

In the normal course of affairs that’s fine: because the HTML is on a page already on ruk.ca, browsers are smart enough to know “that image onetweet.jpg, I’ll look for that on ruk.ca.”

But outside, in the harsh cruel world of email, no such logic applies, and so the images appear broken.

The solution is to change the images to reference the complete absolute URL, rather than just the relative path, like this:

https://ruk.ca/sites/ruk.ca/files/onetweet.jpg

Fortunately there’s a Drupal module called Pathlogic that does exactly that. And it was easy to set up. I just installed the module, enabled it, and then set it to use the “Full URL,” like this:

Screen shot of Pathlogic settings for Drupal

Finally, on the Text Format setting–Full HTML–that I use for my post body field, I checked the “Correct URLs with Pathlogic” setting:

Screen shot of the "Current URLs with Pathlogic" setting for the Full HTML text format

And now the URLs, both here on the blog and in the RSS feed (which is what drives the email subscription system, via MailChimp) work in any context.

Comments

Add new comment

Plain text

  • Allowed HTML tags: <b> <i> <em> <strong> <blockquote> <code> <ul> <ol> <li>
  • Lines and paragraphs break automatically.

About This Blog

Photo of Peter RukavinaI am . I am a writer, letterpress printer, and a curious person.

To learn more about me, read my /nowlook at my bio, listen to audio I’ve posted, read presentations and speeches I’ve written, or get in touch (peter@rukavina.net is the quickest way). 

You can subscribe to an RSS feed of posts, an RSS feed of comments, or a podcast RSS feed that just contains audio posts. You can also receive a daily digests of posts by email.

Search