Categories
Technology

IFrame Widget for WordPress

WordPress Sidebar Widgets have been the latest buzz in the blogdom. Indeed these Widgets elevate WordPress’ standing among the blogwares and encourage community to contribute to the project. With Sidebar widgets, things have become as easy as drag and drop, though you would need “widget compliant” themes. I still wish WordPress had done something with the widgets, the Logahead way, eliminating the need of an admin console altogether, though many would disagree with me saying Logahead is too simplistic to compare, and I may even agree to that argument.

The great part about Widgets is that developing them would be pretty straightforward. No wonder so many widgets have started popping up, they had to create a directory of sorts. Which brings me to the one I created in a jiffy.

Download
Click here to get the IFrame Widget from WordPress Plugins Directory.

This simple IFrame widget can display any external HTML page inside an HTML IFrame component. The need came from the Hindi Tagcloud JSP that I had once created for Chittha Vishwa and I always thought that there should be some way to display that page on my blog (if you are as lazy to edit your blog theme files, you would agree with me).

If you would like to use the Widget the very first thing to do would be to make your Blog Widget ready. Then you can download the IFrame Widget code from WordPress Plugins Directory, and drop it inside the wp-content/plugins folder of your WordPress installation. Once you activate the “My IFrame Widget” plugin you are ready to use it as shown below. The Width, Height and of course the URL are configurable in the Widget.

Deploying the widget:

Widget Drag and Drop
To deploy the Widget simply Drag and Drop as shown.

Configuring the widget:

Widget Drag and Drop
Next you must configure the Widget. Supply the Title, width, height and the URL of the page that should be displayed inside the IFrame.

The widget in action:

Widget Drag and Drop
An IFrame widget in action on the blog sidebar.

Disclaimer: The information provided on this page comes without any warranty whatsoever. Use it at your own risk.

Categories
Technology

Migrating a Roller blog to WordPress

Ok I admit that I never made a formal announcement about it, but this blog has now moved to its new home at http://nullpointer.debashish.com. If you are reading this, you are at the right URL.

This blog used to be happily hosted at the excellent free service provided by the JRoller people. Roller is one of the advanced blogwares around, written using Java and I enjoyed using it throughout. If I could afford Java hosting, I would have probably gone for JRoller again. However, with PHP there is hardly any competition for WordPress. So dear readers, here is Null Pointer on WordPress, running on the pretty Squible theme.

Now to the crux of this post. How did I manage migrating all the Posts and comments from JRoller to WordPress?

It was not simple really; because JRoller does not provide any mechanism to backup blog posts, leave alone the comments. Therefore, I asked the Roller people and Dave Johnson was kind enough to come to my rescue. He gave the plausible suggestion of creating a custom RSS Feed. The basic modus operandi is:

  • create a new template in your blog
  • within the template use the $pageModel object to fetch all entries of your blog
  • iterate through those entries to output your blog in RSS or Atom format
  • create your own name-spaced XML element to represent comments within each item
  • write a simple program that parses that and uses MetaWeblog API to post to your new blog

Now the last step is not that intricate because, guess what, WordPress 2.0 does provide the facility to import a blog from a RSS feed. Yet the ordeal would be far from over, because while WordPress can import posts from your feed it cannot import the post comments. Nothing against WordPress, the RSS 2.0 specification does allow a comments sub element but that can only be a link to the actual comments page. So basically we need to defy them all, add the comments inline in our custom RSS Feed and then modify the wordpress RSS Import Utility to decipher and import the comments as well.

When you are ready with your JRoller blog feed, just backup the existing RSS Importer file (wp-admin/import/rss.php) and place the modified importer PHP there. Rest is easy, only remember to break up your RSS file into smaller chunks if you have a really large blog, the importer has the tendency to timeout often.

WP RSS Importer

  • Click here to view the Roller template to create your custom RSS2.0 Feed that includes comments as well.
  • Click here to view the modified WordPress RSS Importer.

I hope this post helped you, do leave your comments here.

Disclaimer: The information provided on this page comes without any warranty whatsoever. Use it at your own risk.