6

Is it possible to obtain a list of all the items in sitecore that is using common sublayout or XSLT's in presentation tab for rendering i.e. suppose there is sublayout called layout1.ascx that is being used by 5 items.is it possible to obtain the list of all these 5 items by search method.

Thanks in advance.

Regards, Divya

1
  • 1
    Don't forget to mark the answer below as the accepted answer if it worked for you. I know it worked for me! Apr 30, 2014 at 20:38

2 Answers 2

15

You probably need to do this in two steps (or one if it's only 1 template).

You need to use the Link database.

The simplest way of seeing these "links" is to go to the Sublayout or Rendering and go to the "Navigation" menu and then click on "Links". This should show you all the items that point to this current item and all the items that the current items points to (ie. both ways).

This will probably give you a list of templates and/or items (if the sublayout is set directly on an item).

Then go to a template and see how do the same to see which items are have a refernce to the template.

This should show you which items are using which sublayouts.

Of course this requires the Link database is up to do (should be done automatically, but you can force this with Start > Control Panel > Databases > Rebuild Link Database) and that the Sublayouts etc are bound in Sitecore..

I hope this helps.

5
8

The Link database suggestion is great, but if your sublayout is used by hundreds of items, it may take a little while to load.

Another alternative is this fast query:

fast://*[@__Renderings='%{FAAD00AE-A089-4AEF-989C-73917660FF48}%' or @__Final Renderings='%{FAAD00AE-A089-4AEF-989C-73917660FF48}%']

This can be run in the developer center, under Tools > XPath Builder (or for Sitecore 8.x the XPath Builder can be found at /sitecore/shell/default.aspx?xmlcontrol=IDE.XPath.Builder).

Sitecore 9.x no longer supports the XPath Builder, but you can still run this if you install the Sitecore PowerShell Extensions.

The following command can be run:

Get-Item -Path "master:" -Query "fast://*[@__Renderings='%{FAAD00AE-A089-4AEF-989C-73917660FF48}%' or @__Final Renderings='%{FAAD00AE-A089-4AEF-989C-73917660FF48}%']"

Change the guid above as needed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.