.NET and Open Source: better together

RTur.net

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

Insert Code - your options

Code Formatter extension

For those who use BlogEngine as a technical blog (which is pretty common at this stage) code formatting feature is a must. Sure, you can squeeze your code in between “pre” tags and you are done – well, almost – editor will probably remove most of the white spaces and you’ll have to add some non-braking-spaces instead. But if you want coloring and nice formatting you’ll need more than that. There are several options to explore, and most obvious one is BlogEngine’s code formatter extension that comes with installation bits. To use extension you simply enclose your code within square-bracketed tags and specify what language you are going to format. If you do it from Tiny MCE rich box editor, it will add “p” and “pre” tags automatically for you, if you prefer doing it from HTML view you’ll have to add some tags manually, as shown in the picture on the right. Because Tiny MCE has a habit of re-formatting your HTML, based on your configuration results might vary and sometimes not be pretty. And you may not use Tiny MCE at all – if you replaced it with another editor. So you might run into problems using formatting extension, lots of people do (based on discussions in the BlogEngine's forum). No worries – there always more than one way to skin the cat! More...

Going Vegas

Don’t be jealous – I haven’t had real vacation for more than three years now, since my kids were born. These few days in Vegas are well deserved! I’m leaving early Saturday and will be back Wednesday, hopefully in one piece and not much poorer. And I’ve done everything I’ve promised: Dark Blog is up and running and Mp3 Player got face lift and don’t choke in IE any more. What more do you want? No, seriously…

In case you didn’t notice, I “enhanced” this site with SnapShots. If it annoys you too much, you can easily turn it off by opting “disable” in the upper right corner any pop-up that jumps when you hover over some of the links (you’ll have to delete cookies to re-enable it again if you’ll get bored afterwards). I can turn it off all together if you’ll start complaining, but so far I’m more like having fun with these little guys. It took about five minutes total to register and set it up, so if you are into this kind of things go ahead and add it to your own blog, it is really that simple. More...

Mp3 Player - the new release is coming

Since BlogEngine finally got its extensions section up and running on the project’s home page, I put my Mp3 Player extension up there. Also I’ve been pointed on a small glitch this player has – in IE you have to click once to activate it and only after second click it will play. Not a big deal and I did not pay a lot of attention to it, mostly because pretty much every flash player I used so far has this same problem (see the picture). After short investigation I found out that reason Microsoft can’t fix this glitch is a legal one – there is a dispute over a patent going on. But MS (and Flash people) do provide works around “click to activate” problem, most of which comes down to writing “object” tag by JavaSript rather than embedding it directly into HTML code. Can be done in variety of ways for different situations and I think I found one that will work in my case. Needs a bit more testing, but looks like it should work just fine. More...

DarkBlog is ready for download

That was busy weekend – Saturday I went to see amateur AIBA World Boxing Championship, and it took almost all day (finals in all categories from 48kg up to heavyweights). I used to box (and kick) myself, so it was really exiting to dive into it again, it has special atmosphere around it I really like a lot, special sort of excitement. And I play soccer games on Sunday’s – so I was dragged out of cyberspace into reality for a wile :)

But I did manage to finish BlogEngine’s theme I’ve been working on lately, so you can download and try it if you are interested – I added a page for it in the menu bar, or just click this link.

Throwing a punch

Just read a great article at coding horror on becoming a good blogger. It says that it takes at least a year to even get noticed and main peace of advice is to keep punching and feel good about it. Well, it sounds… hmmm… encouraging. Thanks God I’m not aiming that high. Anyways, I decided to follow advice and throw a punch – even though my new shiny theme for BlogEngine is not quite ready yet and I was hoping this will be my next subject. Funny how it goes – takes about an hour to convert any CSS template into BlogEngine theme, this is how simple it is and how good ASP.NET overall and BlogEngine in particular implemented skinning. Almost too good to be true – and it isn’t. Dirty little secret is that it takes ten times more to polish it to the dissent “production” state, when it looks good in all major browsers and scales fine for reasonable range of screen resolutions. I’ve heard that there are about ten testers for every developer in Microsoft – totally makes sense! More...

CSS survival guide, part 2

There are two important things to understand when dealing with CSS - how to address element you are styling and why in the world it does not picking the style you are trying to assign it. For the first part you might consider to install add-in to your browser, there are many for FireFox and IE alike, so that it will actually show element address for you.  For example, Developer Toolbar for FF can show you full path to tag cloud link in the browser panel like shown in the picture. The second important thing to remember is that CSS called "cascading" for a reason: all styles down the road will cancel those on top. Which is a good thing - this way you can style all anchors first and then be able to override style for the second layer anchors canceling some attributes, keeping others and yet adding some on top.  And this is what we generally doing here: first level menu buttons have it's own style, sub-menus keep some of the attributes and cancel others so that sub-menus look different.  To overcome browser incompatibility we will add conditional block to the header of the page: More...

CSS survival guide (developer addition)

When you are a developer working with CSS on “as needed” bases, you have to be prepared for some pain and frustration. Don’t get me wrong, I love CSS – and what not to love? It makes your HTML code clean and light-weight, pages load faster and all formatting logic neatly separated from presentation markup. Beautiful! But I hate it, too. There are two major problems with CSS: it is not intuitive and every browser has its own parser doing job “better” (differently) than others. Practically, it means that when working on CSS you have to fire up 3-4 different browsers and test every line as you go. More...

Transforming unsorted list into CSS horizontal menu

Lately I’ve been working on the new cool theme for BlogEngine that I’m going to share with community. One of the tasks is to let it be more content oriented, which is a bit different then other themes. Basically, it comes down to having good navigation menu that will allow you to utilize stand-alone pages in BlogEngine to its full potential. Currently, you have a choice to make page a “child” of the other page so that pages do have hierarchy and can be nested into the tree-like structure. It just not rendered by BlogEngine this way, at least not right now. To make it happen I used code published on the BlogEngine forum, just making a few changes to fit my needs. This is a simple control that looks inside core library and renders all BlogEngine pages into unsorted list. Then, you can just add it to your theme and here you have it: More...

Keeping track on your downloads

When you provide downloadable content on your blog, you might want to keep track on downloads. With BlogEngine, it is incredibly easy to do – all you need is subscribe to one of the events exposed by core framework and log download information to any medium you like. For example, you want to log it in the tab delimited flat file so it is easy to export to Excel and do whatever kind of reporting you want to do.

First thing, we need More...

New extension for BlogEngine.net

OOk, I'm not much of a blogger, but I did try several blog engines on Microsoft platform and beyond before settling my mind on BlgogEngine.net. I like it a lot for simplicity and elegancy of the code base. May be I'm an old school, but I do prefer applications which code I can comprehend in it's (almost) entirety - it gives me (false) sense of security. The other thing that I like about it is support for extensibility - so you can make that simple elegant code base bloated with tons of stuff that you can package so that it pretends to be an "extension". One problem though is that BlogEngine is relatively new player and there are not too many extensions yet present. So I decided to fix it a bit…

Jokes aside, one thing that BlogEngine is missing is multimedia support. Sure, it's not a core feature and it does belong somewhere in plug-ins directory. And I really needed audio support for one of my projects. After some looking around I found that there quiet a few free flash players you can use in HTML pages (may be Microsoft will come up with knocking-your-socks-off free SilverLight player some day and it will take over the world?). By far, the most popular and slim in-line player I came across is the one used in WordPress blogs. I decided that this is the best candidate for adoption and wrote a little wrapper around this flash player to hook it up with BlogEngine. Extension that I resourcefully named "mp3player" you can download here. There are also some instructions on how to install and use it, and all code is available for you to use and change at will. I intend to maintain and enhance it over the time so any feedback on bugs/issues or suggestions for improvement are greatly appreciated.

Below is an example what it looks like – most likely you’ve already familiar with the picture, which is another advantage of using this particular player. Just click an arrow to test it: