Lambert on Development

My thoughts on software development

Lambert on Development RSS Feed
 
 
 
 

Callouts: I need a WordPress plugin

In a recent post, I wanted to break out a paragraph into a callout or sidebar — a little box of goodness inset into the body of my post. This proved rather more difficult than I’d planned.

Initially, I crafted the callout by hand, using a DIV for the box, and two DIVs within that for the title and body. I putzed with the CSS for a while to get it looking the way I wanted, and when I finally got it looking the way I wanted, I pulled the styles out and coded them in my blog’s stylesheet.

Google Reader Fail!So far, so good. This was shaping up to be a minor pain, but nothing I couldn’t handle. The first big hiccup happened when I realized that the styles for my DIVs weren’t showing up in Google Reader for my RSS feed (you may have noticed this).

Diagnosing this problem turned out to be a much bigger rathole than I expected. Initially, I thought that perhaps my feed just wasn’t referencing my stylesheet, so I started playing with this. Before long, I ended up writing a simple WordPress plugin to add a stylesheet reference to my feed. No matter which event I hooked, though, I couldn’t get the feed to do what I wanted it to do. After way too many attempts to fix this, I finally stumbled on some blogs that pointed out the root problem here: feed readers generally don’t use stylesheets.

Feed readers - FAIL
Needless to say, when I found out that feed readers don’t actually use stylesheets, I was floored. Not only that, but this appears to be a problem almost across the board. There’s a clear opportunity here for someone to step up and lead the way on this issue – someone, please carry this ball forward!

So, the real solution, it appears, is to have the styles embedded in the DIV definitions.  This is ugly for all sorts of reasons that are probably obvious to you, but it’s the only way I can see to solve this problem if I want styles in my feed (which I do).

Given that constraint, I elected to make another plugin — this time, to let me use quicktag-style encoding to type my callout into my post and translate this into appropriately-styled DIVs for display.  As evidenced by the callout in this post, this is progressing nicely.  I’ve checked this plugin into the Wordpress plugin repository, though I’m sure there’s still some fine-tuning to come.

When have you extended a system that didn’t quite do what you wanted it to?

Reblog this post [with Zemanta]

Post to Twitter Tweet This Post

Azure isn’t supposed to do this!

I’m doing some research on Azure (finally playing with the bits), and in the process, spending some time cruising Steve Marx’s blog.  Steve presented some Azure stuff at PDC earlier this year, and there’s some great stuff on his blog if you’re working with Azure for the first time.  One of the things you’ll learn if you watch his PDC stuff is that his blog is, itself, built on Azure and running in the cloud, so it should be a showcase for all of Azure’s scalability claims.

Thus, it was with great surprise that I clicked a link and saw this Azure app apparently taking a dirt nap:

This webpage is not available.

The webpage at http://blog.smarx.com/?ct=1!8!c21hcng-/1!48!MjUyMTc1NjA1Nzk4NDI2NzA1MiBhdC1sYXN0LS1zcGFtLQ– might be temporarily down or it may have moved permanently to a new web address.

I refreshed a couple of times, to no avail, and finally tried going back to the home page, which worked fine.  I’m still not sure exactly what went wrong, but it would appear that the god-awful token that was used to track my navigation got lost in the cloud somewhere.

The lesson here?  For production apps, you’re still going to need to build your Azure apps defensively, and make sure that customer-facing hiccups are handled in a user-friendly fashion.  As a user, I don’t know (or care) if this error was an Azure failure or a failure of the app that’s hosted on Azure.  This isn’t a dreadful error when I’m browsing a blog, but it could have been if I’d been paying bills or making an online purchase.

Post to Twitter Tweet This Post

Zemanta is a blogger’s best friend

Image representing Zemanta as depicted in Crun...

Image by Zemanta via CrunchBase

Shortly before I switched this blog to Wordpress, I learned about a new tool called Zemanta.  It was supposed to provide context-sensitive links and images, chosen dynamically to be relevant to the work in progress.  It sounded pretty cool, and I tried to set it up under Drupal, but couldn’t quite get it done.  After switching to Wordpress, I was happy to see that Zemanta setup was a breeze.

I’ve been using Zemanta for a few weeks now, and I’m really, really happy with it.  My initial impressions were a bit iffy – images were inserted in a way that made it difficult to move the image without leaving the citation caption behind, for instance.  Zemanta keeps improving the plugin and the service, though, and my early problems have lessened considerably.

More »

Post to Twitter Tweet This Post

Wordpress SEO optimization ROCKS!

Image representing WordPress as depicted in Cr...

Image via CrunchBase

One of the things I noticed shortly after switching this blog to Wordpress was the terrific support for SEO optimization.  Wordpress does a very good job of this itself, with good support for keywords, Meta tags, and so on, but there are also some really fantastic plugins for Wordpress that kick it up a notch – I’m using one called All in One SEO Pack that I like a lot.

City of Columbus

Image via Wikipedia

I suspected that this was helping to boost my search rankings, but I just saw a pretty clear indication of the extent.  The post directly under this is all about the 2.Ohio event that was held last night here in Columbus.  As the event was drawing near, the organizers asked the community to tag any related posts with “2dotohio08″, and I was happy to oblige.  Today, I noticed that tag among the “searched-for” terms that led someone here, so I googled “2dotohio08” and was really happy to see that post down there sitting right up near the top of the results.

I wish I could take personal credit for that search ranking, but an awful lot of it is due to great standards support from Wordpress and the All in One SEO Pack.  If you run the search, you’ll also see its entry on MyBlogLog, which seems to help a bit, too.  If you’ve got a web presence, you really need to pay attention to this stuff, because it’s not difficult, and it matters!

Reblog this post [with Zemanta]

Post to Twitter Tweet This Post

Use .htaccess to redirect from Drupal to Wordpress

As I mentioned, I just converted from Drupal to Wordpress, and one of the most difficult parts of the conversion was figuring out how to redirect Drupal’s old urls to the new equivalents in Wordpress.  I’d taken care to carry over ID values intact, so the mapping was easy, and Apache should have been quite capable of doing the url translation for me, but it took a fair bit of trial and error to get it to work right.

Here’s the file that finally worked:


#
# Apache/PHP/Drupal settings:
#

# Various rewrite rules.
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine on

# Rewrite drupal urls to worpress
RewriteCond %{QUERY_STRING} ^q=node/(.+)$
RewriteRule ^(.*)$ http://blog.componentoriented.com/?p=%1 [R=301,L]

# Forward RSS feed
RewriteCond %{QUERY_STRING} ^q=rss.xml$
RewriteRule ^(.*)$ http://blog.componentoriented.com/?feed=rss2 [R=301,L]
RewriteCond %{QUERY_STRING} ^q=atom/feed$
RewriteRule ^(.*)$ http://blog.componentoriented.com/?feed=rss2 [R=301,L]

</IfModule>

Notice the use of RewriteCond before RewriteRule.  When I originally tried this, I used only the RewriteRule statement and tried to match the query string in the first part of the RewriteRule statement.  Needless to say, it didn’t work.

The problem turned out to be that RewriteRule just wouldn’t match query strings (which is where the node ID was), and when I figured out how to use RewriteCond, that turned out to be exactly what I needed.  The %1 instead of $1uses the value that was matched in the previous RewriteCond statement rather than the matched value in RewriteRule.

Finally, you can see that I also forwarded the old Drupal RSS feeds.  If you’re converting from Drupal, this should work for you, and if you’re converting from anything else, hopefully this example will help a bit.

Post to Twitter Tweet This Post

Similar Posts

Google Reader

Blogroll

Blog Directories

 
Programming Blogs - Blog Catalog Blog Directory
 
Computers Blogs - Blog Top Sites
 
Banner
 
Lambert on Development - Blogged

Popular in Blogging Platforms

Recent Posts

Popular Posts

Support this Site

Featured Articles

Lijit Search

Lijit Search