Find pages that uses a specific block type

Vote:
 

Hi,

I would like to find which pages that use a specific block type and was wondering if there is a plugin built for this available?

Otherwise if someone has some sql query for it?

I want to search in production so thats why i would like a sql query and not do it in code for the sql query case.

EPiServer 7.5 is used.

/Kristian

#162075
Oct 10, 2016 14:31
Vote:
 

If you go to Admin mode and try to delete the Block Type I recall it will list the contents it's present on. Inspect the namespace of that ASPX and go hunt using a reflection tool. Maybe you can test that page and catch a SQL call using some Profiler as well.

#162165
Oct 11, 2016 22:43
Vote:
 

Thanks for the answer!

I'm a bit new to EPiServer and I think it would work if the blocktype was not from code as in my example.

I can see the remove button for other types but not for my block that is from code.

Will try remove another type in the meanwhile and see if I can't trace the sql.

#162176
Edited, Oct 12, 2016 9:04
Vote:
 

I know Dejan Caric wrote a blog about that a while back as well if you are looking for some code :)

Check out

http://www.dcaric.com/blog/episerver-9-references-to-content

If you just want the SQL you can always listen to the actual SQL using SQL profiling tools or similar. I would probably have solved it in code but that takes a deploy so...

#162177
Oct 12, 2016 9:23
Vote:
 

Ok thanks!

It doesn't look that hard to solve in code so it's probably the right way to go too :)

#162188
Oct 12, 2016 11:42
Vote:
 

If you're interesting finding content of a specific content type - how about this SQL Query?

SELECT c.pkID FROM tblContent c INNER JOIN tblContentType ct ON c.fkContentTypeID = ct.pkID WHERE ct.Name = 'NAME-OF-YOUR-CLASS'

You can take c.pkID and add into the url of the episerver edit interface for example www.mydomain.com/episerver/cms/#context=epi.cms.contentdata:///ADD-ID-HERE

#162194
Oct 12, 2016 12:51
Vote:
 

Great! thank you!

That helped me achieve what I wanted.

I combined that with the sp editDeletePageCheck and found the references.

#162210
Edited, Oct 12, 2016 15:05
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.