Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

In a SharePoint (MOSS 2007) environment how can I list all the Master Pages (templates) that are used in a site collection? I need to add some code to the header of every master page, but there are a lot of subsites and I don't want to have to go to each subsite and check which master page it is using.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

The master pages available in the Master pages and page layouts gallery at the root site of the site collection are available to all its sub sites. So you need update all the matser pages in there with the required headers.

Once this is done, changes would automatically reflect on all sub sites in that site collection using those master pages.

note: the master pages must be checked-in are approved after the updates

share|improve this answer
    
There are a lot of legacy Master pages there that are not used, I need to be able to tell which are actually in use. –  DrStalker Oct 1 '10 at 6:33
1  
Well there is no straight forward route to find the active master pages from top to bottom in a site collection. You would need to write a console application that can iterate recursively across the site collection and print the values of SPWeb.MasterUrl and SPWeb.CustomMasterUrl property. –  Vivek Oct 1 '10 at 7:11
    
The comment is the accepted answer, not the accepted answer. If that makes sense. :-) –  DrStalker Oct 5 '10 at 22:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.