How to programatically get all linked items for a given Sitecore item?Admin UI for PRC and REP roles not working on Azure PaaS on vanilla Sitecore 9Sitecore Related Items to publish only Related Media items of an itemHow to prevent an item from being moved to another folder accidentally?Remove certain items from control panel for some usersIs there a page on which I can view all Sitecore jobs running?

What modifiers are added to the attack and damage rolls of this unique longbow from Waterdeep: Dragon Heist?

Is there a name for the technique in songs/poems, where the rhyming pattern primes the listener for a certain line, which never comes?

How to get locks that are keyed alike?

What's a good pattern to calculate a variable only when it is used the first time?

Sums of binomial coefficients weighted by incomplete gamma

What is the hottest thing in the universe?

What was the intention with the Commodore 128?

Is this bar slide trick shown on Cheers real or a visual effect?

Is there a word for returning to unpreparedness?

Is the Microsoft recommendation to use C# properties applicable to game development?

What is the farthest a camera can see?

Cusp forms have an orthonormal basis of eigenfunctions for all Hecke operators

Suspension compromise for urban use

How to prevent criminal gangs from making/buying guns?

What species of spider lays their eggs in the flesh of the person they bite?

What would it take to get a message to another star?

Solving a maximum minimum problem

How do I call a 6-digit Australian phone number with a US-based mobile phone?

Locked room poison mystery!

What should I do if actually I found a serious flaw in someone's PhD thesis and an article derived from that PhD thesis?

Why did IBM make the PC BIOS source code public?

How much can I judge a company based on a phone screening?

Did Michelle Obama have a staff of 23; and Melania have a staff of 4?

What if a restaurant suddenly cannot accept credit cards, and the customer has no cash?



How to programatically get all linked items for a given Sitecore item?


Admin UI for PRC and REP roles not working on Azure PaaS on vanilla Sitecore 9Sitecore Related Items to publish only Related Media items of an itemHow to prevent an item from being moved to another folder accidentally?Remove certain items from control panel for some usersIs there a page on which I can view all Sitecore jobs running?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








3















I'm wondering if there is some API/Code/Trick on Sitecore to fetch all linked/related Items to a given Sitecore item, just like we have on the XP Admin interface?



My goal here is to find all pages using a given item as a data source of one of its renderings.



enter image description here










share|improve this question



















  • 2





    Something like Sitecore.Globals.LinkDatabase.GetReferrers(current item) or I missed the point of your question?

    – Marek Musielak
    8 hours ago











  • Actually, that's exactly what I was looking for, thanks Marek :)

    – Hugo Santos
    7 hours ago

















3















I'm wondering if there is some API/Code/Trick on Sitecore to fetch all linked/related Items to a given Sitecore item, just like we have on the XP Admin interface?



My goal here is to find all pages using a given item as a data source of one of its renderings.



enter image description here










share|improve this question



















  • 2





    Something like Sitecore.Globals.LinkDatabase.GetReferrers(current item) or I missed the point of your question?

    – Marek Musielak
    8 hours ago











  • Actually, that's exactly what I was looking for, thanks Marek :)

    – Hugo Santos
    7 hours ago













3












3








3








I'm wondering if there is some API/Code/Trick on Sitecore to fetch all linked/related Items to a given Sitecore item, just like we have on the XP Admin interface?



My goal here is to find all pages using a given item as a data source of one of its renderings.



enter image description here










share|improve this question














I'm wondering if there is some API/Code/Trick on Sitecore to fetch all linked/related Items to a given Sitecore item, just like we have on the XP Admin interface?



My goal here is to find all pages using a given item as a data source of one of its renderings.



enter image description here







admin-pages related-items






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 8 hours ago









Hugo SantosHugo Santos

1,4291 gold badge3 silver badges20 bronze badges




1,4291 gold badge3 silver badges20 bronze badges










  • 2





    Something like Sitecore.Globals.LinkDatabase.GetReferrers(current item) or I missed the point of your question?

    – Marek Musielak
    8 hours ago











  • Actually, that's exactly what I was looking for, thanks Marek :)

    – Hugo Santos
    7 hours ago












  • 2





    Something like Sitecore.Globals.LinkDatabase.GetReferrers(current item) or I missed the point of your question?

    – Marek Musielak
    8 hours ago











  • Actually, that's exactly what I was looking for, thanks Marek :)

    – Hugo Santos
    7 hours ago







2




2





Something like Sitecore.Globals.LinkDatabase.GetReferrers(current item) or I missed the point of your question?

– Marek Musielak
8 hours ago





Something like Sitecore.Globals.LinkDatabase.GetReferrers(current item) or I missed the point of your question?

– Marek Musielak
8 hours ago













Actually, that's exactly what I was looking for, thanks Marek :)

– Hugo Santos
7 hours ago





Actually, that's exactly what I was looking for, thanks Marek :)

– Hugo Santos
7 hours ago










2 Answers
2






active

oldest

votes


















4














You can use from code: ItemLink[] itemLinks = Globals.LinkDatabase.GetReferrers(item);



Or from Content Editor you can use Link ribbon button from Navigate tab:



enter image description here






share|improve this answer


































    1














    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);





    share|improve this answer



























      Your Answer








      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "664"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsitecore.stackexchange.com%2fquestions%2f20525%2fhow-to-programatically-get-all-linked-items-for-a-given-sitecore-item%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      4














      You can use from code: ItemLink[] itemLinks = Globals.LinkDatabase.GetReferrers(item);



      Or from Content Editor you can use Link ribbon button from Navigate tab:



      enter image description here






      share|improve this answer































        4














        You can use from code: ItemLink[] itemLinks = Globals.LinkDatabase.GetReferrers(item);



        Or from Content Editor you can use Link ribbon button from Navigate tab:



        enter image description here






        share|improve this answer





























          4












          4








          4







          You can use from code: ItemLink[] itemLinks = Globals.LinkDatabase.GetReferrers(item);



          Or from Content Editor you can use Link ribbon button from Navigate tab:



          enter image description here






          share|improve this answer















          You can use from code: ItemLink[] itemLinks = Globals.LinkDatabase.GetReferrers(item);



          Or from Content Editor you can use Link ribbon button from Navigate tab:



          enter image description here







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 7 hours ago









          Gatogordo

          13.6k2 gold badges20 silver badges68 bronze badges




          13.6k2 gold badges20 silver badges68 bronze badges










          answered 8 hours ago









          Vlad IobagiuVlad Iobagiu

          14.3k2 gold badges13 silver badges40 bronze badges




          14.3k2 gold badges13 silver badges40 bronze badges


























              1














              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);





              share|improve this answer





























                1














                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);





                share|improve this answer



























                  1












                  1








                  1







                  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);





                  share|improve this answer













                  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);






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 8 hours ago









                  josedbaezjosedbaez

                  1,2528 silver badges29 bronze badges




                  1,2528 silver badges29 bronze badges






























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Sitecore Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsitecore.stackexchange.com%2fquestions%2f20525%2fhow-to-programatically-get-all-linked-items-for-a-given-sitecore-item%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      ParseJSON using SSJSUsing AMPscript with SSJS ActivitiesHow to resubscribe a user in Marketing cloud using SSJS?Pulling Subscriber Status from Lists using SSJSRetrieving Emails using SSJSProblem in updating DE using SSJSUsing SSJS to send single email in Marketing CloudError adding EmailSendDefinition using SSJS

                      Кампала Садржај Географија Географија Историја Становништво Привреда Партнерски градови Референце Спољашње везе Мени за навигацију0°11′ СГШ; 32°20′ ИГД / 0.18° СГШ; 32.34° ИГД / 0.18; 32.340°11′ СГШ; 32°20′ ИГД / 0.18° СГШ; 32.34° ИГД / 0.18; 32.34МедијиПодациЗванични веб-сајту

                      19. јануар Садржај Догађаји Рођења Смрти Празници и дани сећања Види још Референце Мени за навигацијуу