Just today I discovered how to use the FormatPage functionality in dasBlog. This functionality allows you to take a regular plain html file and have it rendered in your site using existing templates etc.
Coupled with URL Rewriting you can create your own custom URLs for these pages. Say for instance that I wish to create a page for some software projects I'm working on, I don't want create a blog post for this because I want it to be permanant and static etc. So I create a simple HTML file and name it:
somefile.format.html
This file should just contain the HTML that would normaly between the tag. Note that the file name must end in .format.html or none of this will work.
You then place this file anywhere in your blog. I like to keep things in my /content folder so I create a new folder called /projects in /content and place the file in there. The path on the server is now:
/content/projects/somefile.format.html
To get to this page in dasBlog I simply type:
http://www.shahine.com/omar/FormatPage.aspx?path=content/projects/somefile.format.html
However, I don't like the way this URL looks. So to address this I go into my Web.Config file and find the section and create a new URL mapper expression.
The following expression:
<add matchExpression=
"(?<basedir>.*?)/Projects\.aspx\?=(?<value>.+)"
mapTo="{basedir}/FormatPage.aspx?path=content/projects/{value}.format.html" />
intercepts all requests to:
http://www.shahine.com/omar/Projects.aspx?=somefile
to
http://www.shahine.com/omar/FormatPage.aspx?path=content/projects/somefile.format.html
and shows the top URL to the user. Basically Projecs.aspx is a non existant page, and dasBlog is magically loading the content in somefile.format.html and displaying it to the user.
Now I can create a number of pages in my new /content/projects folder and I can use the same URL for all of them. I would simply change somefile to whatever the name of the *.format.html file prefix is.