Default Theme Architecture

Topics: Business Logic Layer, Themes
Dec 5, 2011 at 3:09 PM

When making JQ Mobile theme for the BlogEngine.net theme contest, I ran into some situations making a mobile theme that I haven't really encountered before while making a regular theme for BlogEngine.net. I wanted to make the client code as clean as possible and not include any of the javascript or css that comes with BlogBasePage since I wasn't going to need it and also change a lot of the html output that is generated by BlogBasePage, default.aspx, page.aspx, post.aspx, archive.aspx, search.aspx.

I used a ThemeHelper from blog.raisr.net (website seems to be offline now) and some other logic in JQ Mobile's site.master to override the routing to all the aspx pages. What I would like to see done in BlogEngine.net is have a Default theme with all the aspx pages and if a theme has any of those aspx pages in their theme to use that one instead of the default page.

I've made applications in ASP.net MVC and made a custom ViewEngine to create something similiar to what I've decscribed....kinda like this: http://weblogs.asp.net/thangchung/archive/2011/06/10/razor-themed-view-engine-for-multi-themes-site.aspx

I think to make BlogEngine.net more successful for designers to make great themes. I know it will take alot of re-architecture of BlogBasePage and other areas of BlogEngine for themes to be more flexible and not be forced into the html output that BlogEngine currently creates. Since BlogEngine.net is now on asp.net 4.0, I don't think it will be too hard to make something like this since you have routing RouteCollection and check if a page exists in the current theme.

So File/Folder structure something like this:

  • themes
    • Default
      • archive.aspx
      • contact.aspx
      • error.aspx
      • error404.aspx
      • page.aspx
      • post.aspx
      • search.aspx
      • style.css
      • theme.png
      • theme.xml
    • Theme1
      • archive.aspx
      • CommentView.acsx
      • newsletter.html
      • PostView.ascx
      • post.aspx
      • site.master
      • theme.png
      • theme.xml

 

 

Just some food for thought,
Mike

 

Coordinator
Dec 5, 2011 at 3:54 PM

I was approaching it from the opposite direction. Say you create "empty" folder in "themes" and set it as your new theme. Then go to the blog and see empty page, because you have not implemented any templates yet. Then you start adding "postlist", "postview", "page" etc. Not sure which way I would prefer it to work, something to think about, may be I'll try default theme too for comparison.