다음 쿼리를 사용할 수 있습니다. WebPart ASCX 파일의 실제 위치에 대한 경로, 웹 파트가있는 페이지 서식 파일의 코드 이름은 물론 사용되는 페이지의 NodeAliasPath 경로를 나열합니다. 선택한 열을 원하는대로 조정할 수 있습니다.
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
속성은 테이블의 WebPartName
열과 같습니다.