0

I have a requirement like when a user copies an existing page by doing this data sources also copied and the user may not realize when they change content on this item they are changing on the original datasource as well. Is there a way to find out if an item's datasource is shared between multiple pages.

1
  • You can check by clicking Navigate => Links on Datasource item, it will show the list of associated items. Commented May 24, 2021 at 8:56

1 Answer 1

3

You can check by clicking Navigate => Links on Datasource item, it will show the list of associated items

enter image description here

Update - You can use Link Database via GetReferrers method. e.g.

var links = Globals.LinkDatabase.GetReferrers(item);
if (links == null)
return new Item[0];
var linkedItems = links.Select(i => i.GetSourceItem()).Where(i => i != null);
3
  • Thanks for your comment. Actually instead of navigating through each item presentation details and getting the datasource and checking item reference. Is there any way to get the list of reference items of datasource through C# sitecore api/
    – Harish
    Commented May 24, 2021 at 11:32
  • Yes you can create powershell script or simple aspx page for this and write code there to retrieve list Commented May 24, 2021 at 11:44
  • Thank you Gaurav. I will work on it to find the list of item references.
    – Harish
    Commented May 24, 2021 at 12:58

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.