New events in BlogEngine.NET 1.2

Sep 25, 2007

UPDATE: If you need other events than the ones on the list, please tell me so they can be added. 

Because the next version of BlogEngine.NET has a build-in extension framework, we have exposed a lot of new events for extension builders. The more events that are exposed, the more power can an extension have.

You can write extensions that alter the rendered output of a post, block the download of a file or image, log all sorts of actions and a whole lot more. Here is a complete list of the events an extension can subscribe to:

  • Post.AddingComment
  • Post.CommentAdded
  • Post.RemovingComment
  • Post.CommentRemoved
  • Post.Rated
  • Post.Saving
  • Post.Saved
  • Post.Serving
  • Post.MarkedDirty
  • Page.Saving
  • Page.Saved
  • Page.Serving
  • Page.MarkedDirty
  • Comment.Approving
  • Comment.Approved
  • Comment.Serving
  • Category.Saving
  • Category.Saved 
  • Category.MarkedDirty
  • Search.Searching
  • Search.IndexBuilding
  • Search.IndexBuild
  • BlogSettings.Changed
  • ReferrerModule.ReferrerRegistered
  • Utils.EmailSent
  • FileHandler.Serving
  • FileHandler.Served
  • FileHandler.BadRequest
  • ImageHandler.Serving
  • ImageHandler.Served
  • ImageHandler.BadRequest
  • Pingback.Sending
  • Pingback.Sent
  • PingbackHandler.Received
  • PingbackHandler.Rejected
  • PingbackHandler.Accepted
  • PingbackHandler.Spammed
  • Trackback.Sending
  • Trackback.Send
  • TrackbackHandler.Received
  • TrackbackHandler.Rejected
  • TrackbackHandler.Accepted
  • TrackbackHandler.Spammed

43 events in total and then comes all the regular ASP.NET events like BeginRequest and ApplicationError etc. I hope this will get a lot of developers writing cool extensions and share them with the community. See how to write extensions for BlogEngine.NET - it's easier than you might expect.

* Only $4.95/month ASP.NET & Windows 2008 + IIS 7 Hosting! FREE SQL Included

Comments (7) -

Joe
Joe
9/26/2007 12:12:52 AM #

Is there a central place to store configurations for extensions?

Something like:
1) have a central .xml file with markup like
<extensionConfig>
  <section name="MyName">
    <customMarkup>
      <moreMarkup>VALUE</moreMarkup>
    </customMarkup>
  </section>

  <section name="AnotherSection">
    <myMarkup>
      <value>10</value>
      <anotherValue>20</anotherValue>
    </myMarkup>
  </section>
</extensionConfig>

2) Then you could have a class to query something like
ExtensionConfig.GetSection("MyName")
which would return the inner XML for that section. It would then be up to the extension to parse that XML.

I know you COULD use the appSettings, but something *like* what I described above would provide a more robust way to store values....In my opion, anyway.


ps.  how come sometimes it shows the monsterID in the preview, but other times it shows the generic pic?  (for me at least)

Mads Kristensen
Mads Kristensen Denmark
9/26/2007 5:06:15 AM #

@Joe. We don't have a central settings storage for this release. We have thought on various ways of doing it, but it is not as simple as it may sound. Most times you just want to store name/value pairs, but what if you want to store a more complex datatype like a dictionary?

Instead we allow you to store XML or text file for instance in the App_Data folder. That way you are totally in charge of your own settings. Use BlogSettings.Instance.StorageLocation to get the absolute path to the App_Data folder.

Amr
Amr Egypt
9/26/2007 11:40:50 AM #

Hello Mads,
When is version 1.2 release as I want to start customizing my new blog on it rather on 1.1
Best Regards.

Mads Kristensen
Mads Kristensen Denmark
9/26/2007 3:17:14 PM #

Hopefully this weekend or just after

Joe
Joe
9/26/2007 3:56:10 PM #

Is there a place to send extensions we write?

Mads Kristensen
Mads Kristensen Denmark
9/29/2007 11:15:56 AM #

Joe, there will be at about the same time as we release.

Comments are closed

About the author

Mads Kristensen

Mads Kristensen
Program Manager at the Microsoft Web Platform team and founder of BlogEngine.NET.

More...

Month List

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer’s view in any way.