Change Look for Page vs. Blog / Posts

Jul 16, 2008 at 2:59 PM
Hi,
First time BlogEngine.NET user - so far, really loving having a nice ASP.NET based, open source blog tool. I am trying to use it as a simple CMS system to integrate a client's website and blog. I have about 5 static pages, which I display with links in my main menu. I then add a link to "Blog.aspx", which will be the blog. On the static pages, I don't want to see things like Blogroll, Archive, etc, but I want all these to appear when I go to "Blog.aspx".

Is it possible to specify different master pages (ie - one for a "Page", the other for blog-related pages ("Posts", "Blog.aspx", etc), or is there a way in the single site.master to check the page type and add content as necessary?

Thanks in advance!
Dan
Aug 4, 2008 at 2:29 PM
Actually, I have the same problem. I solved it by putting BlogEngine.NET under one subdomain, and putting the rest of the website to another subdomain, linked from the blog to the page and vice versa, and since their theme nearly looks identical, nearly noone notices the page transition ...

This solution is not really *nice*, but BE's capabilities as a CMS do not fulfill my requirements at all, so I decided to use it ONLY for blogging.
Sep 2, 2008 at 8:38 PM
I don't know about the multiple themes, but I have found there are multiple conditions to check to find out if the site.master is on a page:

1.  if (Request.RawUrl.ToLowerInvariant().Contains("/page/"))
2. if (!string.IsNullOrEmpty(Request.QueryString["page"]))
3. if it's the root path and a front page is set

string szRoot = Utils.RelativeWebRoot + "default.aspx";
if ((url.Equals(szRoot)) || (Request.RawUrl.ToLowerInvariant().Equals(Utils.RelativeWebRoot)))
{
BlogEngine.Core.
Page front = BlogEngine.Core.Page.GetFrontPage();
if (front != null)
{
// It's page mode
}}