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?
Why aren't rockets built with truss structures inside their fuel & oxidizer tanks to increase structural strength?
What can I do to increase the amount of LEDs I can power with a pro micro?
How to measure if Scrum Master is making a difference and when to give up
How would armour (and combat) change if the fighter didn't need to actually wear it?
Does the C++ standard guarantee that a failed insertion into an associative container will not modify the rvalue-reference argument?
Escape Velocity - Won't the orbital path just become larger with higher initial velocity?
How to prevent criminal gangs from making/buying guns?
How to get locks that are keyed alike?
Why does this Jet Provost strikemaster have a textured leading edge?
What's a good pattern to calculate a variable only when it is used the first time?
How can I find an old paper when the usual methods fail?
Does an Irish VISA WARNING count as "refused entry at the border of any country other than the UK?"
What are the advantages of this gold finger shape?
A+ rating still unsecure by Google Chrome's opinion
How does the Moon's gravity affect Earth's oceans despite Earth's stronger gravitational pull?
When did Bilbo and Frodo learn that Gandalf was a Maia?
What allows us to use imaginary numbers?
Can anybody tell me who this Pokemon is?
Is there a word for returning to unpreparedness?
Weird resistor with dots around it
What is the most difficult concept to grasp in Calculus 1?
What was the intention with the Commodore 128?
Go to last file in vim
What's the point of writing that I know will never be used or read?
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;
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.
admin-pages related-items
add a comment |
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.
admin-pages related-items
2
Something likeSitecore.Globals.LinkDatabase.GetReferrers(current item)
or I missed the point of your question?
– Marek Musielak
9 hours ago
Actually, that's exactly what I was looking for, thanks Marek :)
– Hugo Santos
9 hours ago
add a comment |
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.
admin-pages related-items
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.
admin-pages related-items
admin-pages related-items
asked 9 hours ago
Hugo SantosHugo Santos
1,4291 gold badge3 silver badges20 bronze badges
1,4291 gold badge3 silver badges20 bronze badges
2
Something likeSitecore.Globals.LinkDatabase.GetReferrers(current item)
or I missed the point of your question?
– Marek Musielak
9 hours ago
Actually, that's exactly what I was looking for, thanks Marek :)
– Hugo Santos
9 hours ago
add a comment |
2
Something likeSitecore.Globals.LinkDatabase.GetReferrers(current item)
or I missed the point of your question?
– Marek Musielak
9 hours ago
Actually, that's exactly what I was looking for, thanks Marek :)
– Hugo Santos
9 hours ago
2
2
Something like
Sitecore.Globals.LinkDatabase.GetReferrers(current item)
or I missed the point of your question?– Marek Musielak
9 hours ago
Something like
Sitecore.Globals.LinkDatabase.GetReferrers(current item)
or I missed the point of your question?– Marek Musielak
9 hours ago
Actually, that's exactly what I was looking for, thanks Marek :)
– Hugo Santos
9 hours ago
Actually, that's exactly what I was looking for, thanks Marek :)
– Hugo Santos
9 hours ago
add a comment |
2 Answers
2
active
oldest
votes
You can use from code: ItemLink[] itemLinks = Globals.LinkDatabase.GetReferrers(item);
Or from Content Editor you can use Link ribbon button from Navigate tab:
add a comment |
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);
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
You can use from code: ItemLink[] itemLinks = Globals.LinkDatabase.GetReferrers(item);
Or from Content Editor you can use Link ribbon button from Navigate tab:
add a comment |
You can use from code: ItemLink[] itemLinks = Globals.LinkDatabase.GetReferrers(item);
Or from Content Editor you can use Link ribbon button from Navigate tab:
add a comment |
You can use from code: ItemLink[] itemLinks = Globals.LinkDatabase.GetReferrers(item);
Or from Content Editor you can use Link ribbon button from Navigate tab:
You can use from code: ItemLink[] itemLinks = Globals.LinkDatabase.GetReferrers(item);
Or from Content Editor you can use Link ribbon button from Navigate tab:
edited 8 hours ago
Gatogordo
13.6k2 gold badges20 silver badges68 bronze badges
13.6k2 gold badges20 silver badges68 bronze badges
answered 9 hours ago
Vlad IobagiuVlad Iobagiu
14.3k2 gold badges13 silver badges40 bronze badges
14.3k2 gold badges13 silver badges40 bronze badges
add a comment |
add a comment |
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);
add a comment |
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);
add a comment |
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);
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);
answered 9 hours ago
josedbaezjosedbaez
1,2528 silver badges29 bronze badges
1,2528 silver badges29 bronze badges
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
2
Something like
Sitecore.Globals.LinkDatabase.GetReferrers(current item)
or I missed the point of your question?– Marek Musielak
9 hours ago
Actually, that's exactly what I was looking for, thanks Marek :)
– Hugo Santos
9 hours ago