Open posts in different master page

Topics: ASP.NET 2.0, Business Logic Layer, Controls, Themes
Nov 30, 2009 at 12:52 AM
Does anyone know of a way to open a post into a different theme / master page? I have seen similar examples about different master pages but don't think they will work because the post urls are built dynamically.
For example... our home page has 3 columns with the posts shown in the left column but if someone clicks on the post we would like it to open in a page with 2 columns. Designing the pages and CSS is no issue but we cannot find where to change the refernce to the master page that is being used for the theme.
Dec 1, 2009 at 8:43 PM

Hi dmayer,

While I'm sure I don't understand all the details of your situation, I suspect that understanding the construction of themes a bit would probably give you the answers to your questions.  Each theme has it's own folder within the "themes" folder that is in the root folder of the Blogengine.NET application.  Inside that theme folder is the site.master for that theme that defines the layout.

Al Nyvelt has two "how to's" that would seem helpful for you.  One is on making different pages look differently:

http://www.nyveldt.com/blog/post/BE-Theme-Tip-Make-the-front-page-look-different.aspx

The other is his "Non Zero" theme that you can examine as an example of using different numbers of columns and styles:

http://www.nyveldt.com/blog/post/Customizable-BlogEngineNET-Theme-NonZero.aspx

In a very simplistic way, you can always construct a link that will open in a particular theme by appending a little querystring information.

So, for example, (still using Al's blog as an example), you could open his front page in the standard theme with this link:

http://www.nyveldt.com/blog/?theme=standard

Adding the ?theme=standard even after a long "post" url works, too.

Best Wishes,

GayLyn

 

Dec 2, 2009 at 6:06 AM

Thank you GayLyn,

Al's post was very insightful for working with other page styles but our issue turned out to be so simple as to add the theme variable in postview.ascx.

I had seen your reply to another post but hadn't thought of putting the variable in postview.ascx

You can see what we were trying to accomplish at http://www.vreads.com

Thanks again

Oct 26, 2010 at 10:23 PM

Hello

I've come across the same requirement where I just need my some pages to use a different theme entirely 

In my case I'm using a BE page which I set as the front page and am wondering if you can tell me where I can set this theme variable like you did.

is it the BlogEngine.Core.BlogSettings.Instance.Theme that was changed?

Many thanks!

--

Sid