Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > How to find static html webparts from database View modes: 
User avatar
Member
Member
sanjay.dandavate-capgemini - 6/6/2012 5:33:06 AM
   
How to find static html webparts from database
Hi,
I have staticHTMLRibonCO static html web part control; I have to find out all the static html web part control using Database Query?

I have KenticoCMS database

SELECT *
FROM [KenticoCMS].[dbo].[CMS_WebPart]
WHERE WebPartName like '%static%'

does not resolve the purpose any idea

User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 6/6/2012 1:05:34 PM
   
RE:How to find static html webparts from database
The webparts placed on a page are stored in an XML format in the document content field. I can't remember what the table and column name is and I am on my phone right now, so I can't easily look it up. I think it's in the CMS_document table though. Take a look there

User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 6/6/2012 3:23:36 PM
   
RE:How to find static html webparts from database
I'm sorry. I misunderstood your question when I answered the first time.
Here is a query that will give you all of the webparts that inherit from Static Html web part


DECLARE @wpid int;
Select @wpid = WebPartID from CMS_WebPart WHERE WebPartName = 'statichtml'
Select * from cms_webpart
WHERE WebPartParentID = @wpid


The reason your query didn't return any results is because of your LIKE wildcards. The Static HTML webpart's codename is 'statichtml' since it starts with 'static' your like expression of '%static%' will not return it in the results because it is looking for something that has text before the word static and possibly after. You can modify your expression to be 'static%' and it will return all webparts where the codename starts with 'static'.

Does this help?

User avatar
Kentico Support
Kentico Support
kentico_janh - 6/7/2012 2:12:42 AM
   
RE:How to find static html webparts from database
Hello,

If you want to select documents, where the static text web part is used, please run following SQL query:

SELECT NodeAliasPath FROM View_CMS_Tree_Joined WHERE DocumentPageTemplateID IN (SELECT PageTemplateID FROM CMS_PageTemplate where PageTemplateWebParts like '%type="statictext"%') AND SiteName = '<yourSiteName>' GROUP BY NodeAliasPath


Best regards,
Jan Hermann