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

I'm trying to analyse how an existing MOSS 2007 publishing site is composed but I don't see any obvious way of identifying the type of the various web parts already in use within pages. Is there any way of telling definitively?

share|improve this question

3 Answers 3

up vote 2 down vote accepted

You can add ?contents=1 to the end of your page's URL to get a nice neat list of all the webparts that are currently opened and closed: http://sharepointsolutions.blogspot.com/2008/04/when-good-web-parts-go-bad.html

share|improve this answer
    
Genius! Thanks very much. –  stovroz Feb 23 '11 at 15:32

Are you an author on the page? You can export a Web Part and look at the XML to see what object it references.

If you're trying to figure it out using the rendered source, that's not 100% reliable... well built Web Parts don't exactly add markup/code to advertise what they are as that adds unnecessary markup to the page weight.

For publishing sites (specifically the content regions), if they were done the right way, they used field controls and not Web Parts.

share|improve this answer
    
I'm a site collection administrator if that's any help. If there's a way of enumerating them programmatically I'd be prepared to write something to sit in the MasterPage and list their types if absolutely necessary. Not all the web parts are exportable so I can't rely on that XML unfortunately. Seems crazy to me that it isn't easier to tell their types. And I don't think saving on page weight has ever concerned a developer of any part of Sharepoint I've ever seen. What do you mean by using field controls instead of Web Parts by the way? Surely they solve very different problems? –  stovroz Feb 22 '11 at 21:32

In case anyone's interested I came up with the following solution based on the http://spservices.codeplex.com/ jQuery library, before seeing Kit's rather more straight forward approach in the accepted answer. Still, might be of some use one day:

$().SPServices({
    operation: "GetWebPartProperties2",
    pageUrl: window.location.pathname,
    storage: "Shared",
    completefunc: function (xData, Status) {
     $(xData.responseXML).find("type").each(function() {
         $("body").append("<li>" + $(this).attr("name") + "</li>");
     });
    }
});
share|improve this answer

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.