.NET and Open Source: better together

RTur.net

  • Join Us on Facebook!
  • Follow Us on Twitter!
  • LinkedIn
  • Subcribe to Our RSS Feed

Export Existing BlogEngine Comments Into Disqus

For some time now BlogEngine supports multiple commenting systems, from built-in to 3rd party, like Facebook or Disqus. Switching from one to another is as simple as selecting an option in the admin. The catch is, if you have existing comments and want to bring them over - you on your own. Here I'll cover relatively painless process exporting your comments into popular Disqus commenting system.

Full discloser - I do not necessarily recommend moving your comments to Disqus, personally I'm doing it for my own reasons. Internal BlogEngine comments work just fine. Using Disqus would help to unload your blog when you have tons of visitors and it starts to impact performance, I suppose. But it also can potentially bite you down the road, for example you might as well run into limitations on comment traffic in Disqus or they can make it paid for, annoy you with ads or something else to degrade experience. Right now they doing pretty good job, but you never know, so don't tell I haven't warned.

If you still want to take a plunge, here is how you do it.

Creating Disqus Account

Head over to https://disqus.com and create new account if you don't have one. Once you have an account, you can add sites to this account It has to be publicly available over web, not local, and unique within Disqus. For example I could add "rturnet" as site name and provide "http://rtur.net/blog" as site URL.

Exporting from BlogEngine

Navigate to admin panel in BlogEngine and load advanced settings (admin/#/settings/advanced). Click "Export" button and save generated file, by default BlogML.xml. This file is in BlogML format, and Disqus can only read its own custom format, so we need to convert BlogML to Disqus import file. This console application can do conversion or use this compiled executable (BlogML2Wp.zip (4.71 kb)) if you don't want to deal with Visual Studio and source code. Once you have BlogML.Output.xml you ready to load your BlogEngine comments into Disqus.

Importing Into Disqus

Importing into Disqus is pretty simple, navigate to https://import.disqus.com, select your "forum" (site you created in the first step). Upload your BlogML.Output.xml using provided form and wait a little for the file to be processed. Here is screen after loading small test file with 2 posts and 3 comments.

If you click "forum" name in this screen, you'll see details page. This details page will also show any export errors, if any. In my case, after loading over 1,000 comments I had 4 old comments having export errors which I safely ignored.

All threads should be added to Disqus admin and imported comments should appear in the moderated list. At this point, you ready to connect Disqus with BlogEngine.

Switching BlogEngine to use Disqus

In the BlogEngine admin panel, go to settings/comments and select Disqus as your comment provider, enter site name and save changes.

You should be done by now, but I found one small issue I had to resolve for Disqus comments to show on the site. I'm using latest BlogEngine with URL slug instead of post ID. So I had to modify Disqus URL in my blog to use absolute link instead of permalink. You'll have to FTP to your site and make an edit in /post.aspx.

That is it, your site should be using Disqus instead of built-in comments now. You can delete your internal comments if you want to or keep them around just in case. They will not interfere and will be ignored as long as you using Disqus as your comment provider.

Enjoy!

Post Paging Extension

Reading this thread on Codeplex I was going to write that no such functionality exists but probably easy to add. But then I though just how easy it really would be? So I fired up Visual Studio and about half an hour later I got functioning plugin that does exactly what requested. And this is why I like BlogEngine - it is insanely easy to customize. At least, when you get used to it because documentation admittedly sucks. More...

Custom Fields

Usually blogs have well known structure, which is understandable; one of the core ideas behind blogs is ability to "talk" to each other using RSS, format that defines very strict set of entries like "post", "category" or "tag". Also common format helps to move data from one blog engine to the other making your data portable - big plus. But there are times when you want to go beyond this limitation, and add something valuable to you and your readers. So there is need to extend blog's data structure somehow to hold this extra data. For example WordPress adds meta tables for most main entities, and you have post meta, comment meta, user meta etc. I don't necessarily like this approach as it tightly binds extensibility points to existing structure. To borrow from famous Rumsfeld's rant, those are "known unknowns", and sometimes we have to deal with "unknown unknowns". Maybe single generic entry where post or user defines a type would be a better choice, because then we could add new type instead of creating new entry (table). This also allows (oh my!) to have meta for meta entries and not just stick another key/value pair into the post or comment. More...

Jcarousel extension for BlogEngine

This new extension for BlogEngine will let you save images for multiple albums and display any album in carousel-like fashion in your posts and pages using jCarousel plugin for jQuery. It is light-weight and pretty easy to use. I reused code from NivoSlider as foundation, making few improvements and adding ability to create thumbnail images on the fly. You install it from dnbegallery.org and access extension UI under admin/appearance where you should see "Jcarousel" in the menu list in the right side-bar. There you can upload images. To display album on the page as in this post, you add "CAROUSEL:AlbumName" to the post, substituting quotes with square brackets. More...

BlogEngine.NET 2.7 (RC) is out - upgrade it the easy way

imageBeta (or RC) version of BlogEngine.NET 2.7 has been released this weekend with some cool new features like extension-less URLs and lots of small improvements and bug fixes. If you want to test drive it, head over to Codeplex site and download the latest. More...

BlogEngine 2.6 Updater

BlogEngine 2.6 release is out and you might want to upgrade your existing blog to take advantage of all the new features. You can read instructions how to manually upgrade your site or you can try updater utility I've been using lately to automate upgrades for my blog, it worked well for me and chances are it'll work for you too. It doesn't do database part, so you'll need to do some extra work to run database script and update web.config with connection string. For XML provider all you need is follow instructions below.

Lets assume you use c:\upgrade directory for this exercise.

- Download 2.6 release (web), unzip and copy files to c:\upgrade\be26
- Pull your existing blog to c:\upgrade\old using FTP client like FileZilla
- Download and extract BeConsole.exe to the same c:\upgrade directory
- Create new folder: c:\upgrade\blog
- Open command line, change directory to c:\upgrade and run this command:

beconsole -u c:\upgrade\old c:\upgrade\be26 c:\upgrade\blog

The c:\upgrade\blog now should have your blog upgraded to version 2.6 and ready to be uploaded to your host. I tested it upgrading from 2.0 and 2.5 versions and it worked quite well. Let me know if you run into issues and I'll try to improve it more. May be we can plug it into next BlogEngine for one click auto-update, who knows.

Customizing Post Navigation

Post navigation in BlogEngine is a little hard to customize. By default it looks like picture below and that works fine with standard theme. Small problem is that those angle brackets and "|" in the middle not that easy to get rid of without some nasty CSS tricks because they baked into the core code that nobody likes to touch (or you'll have to remember to carry it over during upgrade). Good news is that you don't have to touch it and still modify navigation any way you like pretty easily if you follow this little guide. More...

BlogEngine.Web–Web Application Project

imageConverting BlogEngine.NET to Web Application Project has been a popular exercise ever since Microsoft introduced WAP project template for Visual Studio. Without getting into nitty-gritty of arguing about advantages one has over the other, converting from web site to web application is easy enough for BlogEngine.NET community to have both models. It just makes sense to have WAP version in some way linked to “proper” BlogEngine.NET so we won’t be reinventing the weal but improve on the single code base instead. More...

Password protect posts and pages in BlogEngine

MB_0024_LOCKSometimes you might want to protect individual posts or pages with a password so that only users you sent password to can access this resource. Not exactly wide-spread scenario, which explains why it is not currently supported by BlogEngine. But when you need it you need it, and this extension should cover the basics. More...

Heart Beat the New Theme for BlogEngine

HeartBeatI was looking for a warm colorful theme for my kids/family site and this one from ezwpthemes.com looked like a good fit (leaving aside it is in the dating category…). Anyways, I did little experiment and slightly changed my routine converting Wordpress themes by going straight to “view page source” and working with raw HTML instead of dealing with server-side code. This time I actually got down and dirty to all those PHP files and built theme by merging templates and replacing PHP code with ASP.NET equivalents when possible. It wasn’t hard at all, which proved a point I had in mind going to PHP files in the first place. I think it is relatively easy to build a converter that will take Wordpress theme and spit out theme for BlogEngine. Wouldn’t that be awesome? Ok, it won’t get 100% result, some things will need to be worked out after post-conversion process by hand. But even if it will get 80% of the job done, I’d take it. I just might try it some day!

Meanwhile, give a try this new theme. It looks best in BE 2.5, but also works fine with version 2.0. If you find any problems, drop a line here.

Theme can be downloaded from the dnbegallery and you can preview it here.