Answered by:
master page.

Question
-
Hi all
Today i was trying to create a master page for my simple application, after reading different forums i got to know that i have to place my master page in the folder where feature.xml is stored and i wrote module information to include my master page in the master page gallary, everyting went fine and now i can see master page available in master page gallary.
I have created a custom page and now referring the master page and got to know that master page which is to be referenced in the custom page must be located in the layouts folder. so i have to place my master page in 2 locations (feature folder and layouts folder), custom pages are also working well.
Is it a good practice? what if want to maintain a single copy of the master page in master page gallery and that should also be referenced by the custom pages. In custom page HTML i tried to us the path "masterPagefileURL=~masterurl/mymaster.master" but got error.
- Edited by Mike Walsh FIN Thursday, January 27, 2011 9:44 AM Need help in removed. Should not be in title
Wednesday, January 26, 2011 6:20 PM
Answers
-
For SharePoint 2007 you are doing it the right way. In 2007 pages stored in a content database must use a master page stored in the content database also, normally one stored in the master page gallery. But pages stored in the _Layouts virtual directory must use a master page that is also stored in the _Layouts virtual directory. So you need to have the master page in two places if you want to use just one master page.
In SharePoint 2010 you can set the master page to reference the same master page as the regular pages in the site by using a dynamicmasterpageurl attribute, but that doesn't work in 2007. With the dynamic master page url pages in the _Layouts directory can use the regular site master (~masterurl/default.master) instead of a master page stored in _Layouts.
Paul Stork SharePoint Server MVP- Proposed as answer by sadomovalexMVP Wednesday, January 26, 2011 9:03 PM
- Marked as answer by Shafaqat Thursday, January 27, 2011 9:04 AM
Wednesday, January 26, 2011 6:44 PM
All replies
-
For SharePoint 2007 you are doing it the right way. In 2007 pages stored in a content database must use a master page stored in the content database also, normally one stored in the master page gallery. But pages stored in the _Layouts virtual directory must use a master page that is also stored in the _Layouts virtual directory. So you need to have the master page in two places if you want to use just one master page.
In SharePoint 2010 you can set the master page to reference the same master page as the regular pages in the site by using a dynamicmasterpageurl attribute, but that doesn't work in 2007. With the dynamic master page url pages in the _Layouts directory can use the regular site master (~masterurl/default.master) instead of a master page stored in _Layouts.
Paul Stork SharePoint Server MVP- Proposed as answer by sadomovalexMVP Wednesday, January 26, 2011 9:03 PM
- Marked as answer by Shafaqat Thursday, January 27, 2011 9:04 AM
Wednesday, January 26, 2011 6:44 PM -
thank you sir and i think its time to move to 2010.
thanx again.
Thursday, January 27, 2011 9:04 AM