次のクエリを使用できます。 WebPart ASCXファイルの物理的な場所、使用されているページのNodeAliasPath、WebPartが配置されているページテンプレートのコード名のパスを一覧表示します。選択した列を好みに合わせて微調整できます。
SELECT DISTINCT
WP.WebPartFileName, -- Physical location of the webpart file
NodeAliasPath, -- Alias path of the page that uses the webpart
PageTemplateCodeName -- Code name of the template that contains the webpart
FROM CMS_WebPart WP
INNER JOIN
(
-- Convert the PageTemplateWebParts column to XML
-- Get the 'type' attribute from all 'webpart' elements, as the 'WebPartName' column
SELECT
PageTemplateID,
PageTemplateCodeName,
T.N.value('@type', 'varchar(50)') as WebPartName
FROM CMS_PageTemplate
CROSS APPLY (SELECT CAST(PageTemplateWebParts AS XML)) as X(X)
CROSS APPLY X.X.nodes('/page/*/webpart') T(N)
) TemplateWebParts ON WP.WebPartName = TemplateWebParts.WebPartName
-- Join the Tree view, to get NodeAliasPaths of pages that use the template
INNER JOIN View_CMS_Tree_Joined T ON T.NodeTemplateID = TemplateWebParts.PageTemplateID
ORDER BY NodeAliasPath
Kenticoでは、WebPartsはページテンプレートに配置され、ページテンプレートに関連付けられます。 PageTemplateWebParts
の列には、その設定とともにXMLとして表示されます。
webpart
要素のtype
属性は、CMS_WebPart
表のWebPartName
列に相当します。