How to programatically get all linked items for a given Sitecore item?Admin UI for PRC and REP roles not...
Angles between vectors of center of two incircles
How best to join tables, which have different lengths on the same column values which exist in both tables?
Reducing contention in thread-safe LruCache
Earliest evidence of objects intended for future archaeologists?
!I!n!s!e!r!t! !b!e!t!w!e!e!n!
How can I train a replacement without them knowing?
Independence of Mean and Variance of Discrete Uniform Distributions
Do predators tend to have vertical slit pupils versus horizontal for prey animals?
How do we test and determine if a USB cable+connector is version 2, 3.0 or 3.1?
Have made several mistakes during the course of my PhD. Can't help but feel resentment. Can I get some advice about how to move forward?
Is there a commercial liquid with refractive index greater than n=2?
Starships without computers?
iPad or iPhone doesn't charge until unlocked?
Just one file echoed from an array of files
Would it be illegal for Facebook to actively promote a political agenda?
Can others monetize my project with GPLv3?
Have only girls been born for a long time in this village?
Atmospheric methane to carbon
Check disk usage of files returned with spaces
Does the Temple of the Gods spell nullify critical hits?
Are unaudited server logs admissible in a court of law?
Which basis does the wavefunction collapse to?
What causes burn marks on the air handler in the attic?
Can 'in-' mean both 'in' and 'no'?
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
Aug 15 at 18:43
Actually, that's exactly what I was looking for, thanks Marek :)
– Hugo Santos
Aug 15 at 19:03
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 Aug 15 at 18:41
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
Aug 15 at 18:43
Actually, that's exactly what I was looking for, thanks Marek :)
– Hugo Santos
Aug 15 at 19:03
add a comment |
2
Something likeSitecore.Globals.LinkDatabase.GetReferrers({current item})
or I missed the point of your question?
– Marek Musielak
Aug 15 at 18:43
Actually, that's exactly what I was looking for, thanks Marek :)
– Hugo Santos
Aug 15 at 19:03
2
2
Something like
Sitecore.Globals.LinkDatabase.GetReferrers({current item})
or I missed the point of your question?– Marek Musielak
Aug 15 at 18:43
Something like
Sitecore.Globals.LinkDatabase.GetReferrers({current item})
or I missed the point of your question?– Marek Musielak
Aug 15 at 18:43
Actually, that's exactly what I was looking for, thanks Marek :)
– Hugo Santos
Aug 15 at 19:03
Actually, that's exactly what I was looking for, thanks Marek :)
– Hugo Santos
Aug 15 at 19:03
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 Aug 15 at 19:27
Gatogordo
13.6k2 gold badges20 silver badges69 bronze badges
13.6k2 gold badges20 silver badges69 bronze badges
answered Aug 15 at 18:48
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 Aug 15 at 18:44
josedbaezjosedbaez
1,2578 silver badges29 bronze badges
1,2578 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
Aug 15 at 18:43
Actually, that's exactly what I was looking for, thanks Marek :)
– Hugo Santos
Aug 15 at 19:03