TabsExtension for BlogEngine.NET v0.2

Maybe you've already heard about Enhanced BlogEngine.NET, a customized BlogEngine.NET which supports multiple languages. Because I'd like to write my posts in english and german in the future, I gave it a try and installed it on a different domain. I had to change some lines of my theme and then tried to copy my posts to the new installation. This took some time but finally I got it and I could play around...

Unfortunately the concept behind Enhanced BlogEngine.NET cannot really convince me. The posts are saved in different files for each language, so there would be one file for the english version, one for the germen etc. Comments and ratings are stored separatly for each language in the according files. Even tags and categories exist for different languages and are only displayed, if the according language is selected. So the only advantage over to separate blogs are in my opinion the link in each multilingual post that leads to a version in another language and that I don't have to switch between to blogs to write my posts. There are maybe scenarios, where Enhanced BlogEngine.NET is fitting, but for me it is no option at the time.

Instead of that I thought about writing an "Enhanced TabsExtension" for BlogEngine.NET, which I could use for my multilingual posts. And what came out in version 0.2 of this extension you can see below:

New language tabs
Version 0.2 of my TabsExtension now supports "language tabs". Give your tab a name like "en" or "de" and the tab's labelled with the appropriate title and flag. The flag images come from the BlogEngine folder /pics/flags. Since there are no language flags but country flags you maybe have to copy and rename some of them (e.g. us.png or gb.png to en.png)

How to use
All instructions you can find in this post about the TabsExtension.

Download
TabsExtension_v0.2.zip (3 kb)

Neu: Sprach-Tabs
Die Version 0.2 meiner TabsExtension unterstützt nun "Sprach-Tabs". Wird einem Tab der name "en", "de" etc. gegeben, so wird automatisch die entsprechende Flagge und die Sprache dazu angezeigt. Die Flaggen werden direkt aus dem Ordner /pics/flags geholt. Weil dort aber nicht Sprach- sondern Landes-Flaggen liegen, müssen unter Umständen noch einige Bilder umbenannt werden. So ist z.B. keine Flagge für Englisch (en) vorhanden, sodass entweder us.png oder gb.png kopiert und in en.png umbenannt werden muss.

Wie funktioniert die TabsExtension?
Alles andere funktioniert wie in diesem Post über die TabsExtension beschrieben.

Download
TabsExtension_v0.2.zip (3 kb)


Posted by Dave on 3/29/2009 at 4:12 PM
Tags: ,
Categories: BlogEngine.NET
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed

TabsExtension for BlogEngine.NET

Today I wrote my first extension for BlogEngine.NET: TabsExtension.

To show you the functionality I put all info in some tabs.

Copy TabsExtension.cs into the App_Code/Extensions folder of your BlogEngine.NET installation. That's it.

The syntax for the tabs is as follows:

[ tabs]

[ tab=Tab Title]

Tab content.

[ /tab]

[ tab=Title for Tab 2]

Tab content.

[ /tab]

[ /tabs]

(Without the spaces after the left parentheses!)

The TabsExtension uses unobtrousive javascript for showing and hiding the tabs and therefor jQuery. If javascript is disabled or not available, the tabs navigation is shown as an unordered list with links to the different tab divs (links like #Tabs1_Tab1). In this version the jQuery library is loaded directly from the jQuery website (http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js). I'm planning to extend this extension to enable configuring the path in the settings dialog.

For now the css is written directly into the page. In further versions I'm planning to let you set the path for a css file. Naturally you can edit the main css file of your theme, the classes are the following:

  • .tabs: The tab container (div) which contains the navigaion and the tabs.
  • ul.tabsnavigation: The navigation for a tab group (ul)
  • .tab: The single tab (div)

Posted by Dave on 6/5/2008 at 12:11 AM
Tags: ,
Categories: .NET | BlogEngine.NET
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (5) | Post RSSRSS comment feed