There is a new version of Mp3 flash audio player extension for BlogEngine 1.3 available for download. Please note that it will not work with BE 1.2 because it uses Extension Manager. The new in this version is an admin page that will let you to change how player looks. You’ll be able to change colors and sizes through the settings interface. I did this as an exercise to show how you can use your own admin page AND still take advantage of some of the Extension Manager features. More...
BlogEngine 1.3 has been released this weekend, so now I can take a deep breath and relax a little. Last couple of weeks I've been torn between two deadlines, one on Extension Manager rushing into 1.3 and another on my day job. One down, one to go...
Last night I upgraded my blog to 1.3, so now it runs on latest and greatest code base. Not sure if I followed best practises, but it did work so for those curious these are the steps I followed: More...
As APIs for Extension Manager finalized, I decided to put together a few simple examples explaining how you can take advantage of them. Consider situation when you have an extension that uses couple user specific variables. For instance, Akismet extension by Justin Etheredge needs to know API key and URL that specific for each blogger who uses extension. Currently, blogger has to enter this information by hand in the source code or extension author has to craft his own admin UI. Chunk of code below shows how Extension Manager can make life easier. All you need is to specify parameters you want blogger to be able to maintain and let Manager know about it. More...
And I’ve listened. There are two big changes in the latest Extension Manager version – you can bring in your own admin UI and default settings page provided by manager became dynamic. Now it is not just two predefined boxes, you can add as many parameters as you like. More...
It is subject to change based on input I’ll get, but here is how you can use Extension Manager that is in the BlogEngine build 8474 when you write extension. To utilize manager functionality you first of all need an extension that requires some kind of customization, probably you want users be able to change values set by you as defaults. If so, you can use manager to create default property page for your extension, save default values and let user change them later on. Here is how you save list of default parameters to Extension Manager using BBCode as example: More...
First of all, Mads asked me to join BlogEngine team and contribute by implementing Extension Manager as a part of BE core functionality, and I’ve agreed. If you downloaded latest bits you’ve probably noticed that it already has Extension Manager in it, although you might run into issues using it. It is very early in development and there been lots of small changes and playing around at this stage. One issue Mads pointed at was the fact that, when edit source code, IIS also reloads worker process, not only the application. More...
Quick update: for those using mp3player, I noticed that it throws NullReferenceException in the latest BlogEngine builds. To fix it, go to extension source code (/App_Code/Extensions/mp3player.cs) and change from: More...
By now we have simple and functional admin interface for extension management. Let’s go beyond basics, how about default settings page that extension writers can take advantage of? Let me explain what I mean. Suppose, you wrote BBCode extension (hope Mads won’t be mad at me:). It let people use XHTML in their comments without compromising security. The way it works: you define a square bracket syntax that people can use and extension converts it into real markup on comment serve. This is what code looks like: More...
You might say – editing source code is easy. Just open Visual Studio and start typing. Not so fast – what if I want to do it online, the way WordPress plug-in manager does it? Let’s say I uploaded extension and it seems to have a bug or I want to make a quick change and I don’t have access to do it over FTP. Is this even possible remotely change code for compiled assembly, save your changes and make application use new code? Let’ try it.
I added new “Edit” link to each extension in the list (if you don’t know what I’m talking about see previous post on Extension Manager). Then I created user control inside “User controls/xmanager” folder named “SourceEditor.ascx”. This is a simple control that have a multi-line text box and a save button. When “Edit” link clicked, page will load this control and fill it up from the source file. It will look inside “~/App_code/extensions” for the file with the same name as extension name. It is not required to put your extensions there, but it is a common convention. If source for extension in some other place – we won’t bother, just show relevant message and disable save button.
When source file found, it will show up in the text box and you can edit it and click save button. One catch here is that you need to disable validation on the page; otherwise ASP will not let you submit control to prevent code injection. Once validation knows that we are good guys and not sending evil things to the server, it all works as a charm. Here is entire code for control that let you easily edit source code for extension from admin panel. It is pretty short and self-explanatory. And you don’t even have to reload application this time; because we changed file in the app_code folder, IIS automatically will kick in jitter to re-compile assembly and start using modified extension. More...
BlogEngine has excellent extensibility model, core libraries expose any significant event you can think of to the outside world and you can subscribe to this events from your code and get access to the posts, pages, comments, files etc. And it does not take a lot to write extension – all you need is to decorate your class with [Extension] attribute. On application load BlogEngine uses reflection to lookup types in the compiled assembly and, if class decorated as extension, BE creates instance of this class. Here is a code from Global.asax that does just that: More...