Is it possible to assign different master pages to different pages?

A place for discussion about skinning and design. Before posting questions here you should review the documentation about creating skins.

This thread is closed to new posts. You must sign in to post in the forums.
11/7/2007 6:49:46 AM
Gravatar
Total Posts 3

Is it possible to assign different master pages to different pages?

Hello.

I am aware that I can set different skin on different pages, but a common scenario (at least for me :-) ) is that e.g. the first page use a completely different layout than most other "content" pages. E.g. the center pane covers the entire screen and the right panes is not visible at all, but on most other pages, there are stuff in the right pane and there is also a margin between the right pane and he center pane.

How do I solve this layout? The first page layout and the "other pages" layout are usually almost the same (almost the same css and images) so creating different skins seems a bit stupid since that means that I have to duplicate all css and images in two different images.

Or, when I think about it, can I:

  1. create two different skins for example myskin1 and myskin2 with different layout.Master.
  2. create another skin (or only folder) named for example myskincommon that contains all css and images.
  3. Make style.css in myskin1 and myskin2 only contain the line @import(../myskincommon/style.css)

Has anyone done this?

Another solution would be to make it possible for each page to specify which master page each page should use but that would

  1. be a source code change
  2. cause problems when changing skin for the site since that master page may not exist in the new skin.

So maybe the css solution with a "common" skin is best? Opinions?

/Andreas

11/7/2007 6:55:00 AM
Gravatar
Total Posts 18439

Re: Is it possible to assign different master pages to different pages?

All the included skins already handle this problem gracefully. If you put content on the page in the right pane the center pane will make room for it. If there is no content on the right the center will take up the available space. So in most cases you only need one skin.

In the case where you do really need a different skin set the main skin as the default site skin and set the home page to use a specific skin.

Hope it helps,

Joe

11/7/2007 7:01:32 AM
Gravatar
Total Posts 3

Re: Is it possible to assign different master pages to different pages?

OK, now I see. I have set the size of the panes (3-column fixed size sitelayout) by settings width on the container of the panes in CSS which make the panes (actually the pane container) take room no matter if there is any content in it or not.

So i guess I can set the size of the pane divs instead which would make the panes "disappear" when there is no content in them.

I will test that. Excellent :-).

/Andreas

11/7/2007 7:15:10 AM
Gravatar
Total Posts 18439

Re: Is it possible to assign different master pages to different pages?

See the documentation here:

http://www.mojoportal.com/understandingthelayoutmasterfile.aspx

You should not change the css class names on the divRight, divLeft, or divCenter in layout.master. The system assigns classes with specific names as indicated on the page linked above according to whether there is content in the div. You can edit the css classes but should not change the names of them. The assignment of these classes is how system handles the layout correctly. Basically, if there is content in the right the center gets assigned the class center-rightmargin to the divCenter and this uses a margin to make room for the right.

Joe

You must sign in to post in the forums. This thread is closed to new posts.