Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ivan 165 posts 543 karma points
    Apr 02, 2018 @ 14:49
    Ivan
    0

    Content Picker: Find all nodes referencing other node.

    Is there a way to find all nodes referencing specific node via Content Picker?

    Say, I want to find all pages which refer (via Content Picker) to banner with id 12345.

    e.g. uHelper.GetReferencedNodes(12345);

  • Alex Skrypnyk 6182 posts 24284 karma points MVP 8x admin c-trib
    Apr 02, 2018 @ 15:41
    Alex Skrypnyk
    1

    Hi Ivan

    Did you look at Nexu package? - https://our.umbraco.org/projects/backoffice-extensions/nexu/

    I can track references to the node via content picker and other pickers. Or do you need to get all links via code?

    Thanks,

    Alex

  • Ivan 165 posts 543 karma points
    Apr 03, 2018 @ 08:31
    Ivan
    0

    Thanks, Alex!

    The Nexu package is great. However we need to get all references from within the code.

  • Alex Skrypnyk 6182 posts 24284 karma points MVP 8x admin c-trib
    Apr 03, 2018 @ 09:10
    Alex Skrypnyk
    1

    You can have a look at source code of Nexu - https://github.com/dawoe/umbraco-nexu/tree/develop/Source

  • Alex Skrypnyk 6182 posts 24284 karma points MVP 8x admin c-trib
    May 11, 2018 @ 09:14
    Alex Skrypnyk
    0

    Hi Ivan

    Did you find a way to find all nodes referencing specific node via Content Picker? We need to do similar - find all media that were removed but are selected in nodes, is it working?

    Alex

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    May 15, 2018 @ 10:21
    Dave Woestenborghs
    1

    Hi Alex,

    You can find all media that are used in a content node like this when using nexu :

    var relatedPages = ApplicationContext.Current.Services.RelationService.GetByParentId(contentPageId)
        .Where(x => x.RelationType.Alias == Our.Umbraco.Nexu.Core.Constants.RelationTypes.DocumentToMediaAlias).ToList();
    

    Than you can check if the page is in the recycle bin.

    Dave

  • Ivan 165 posts 543 karma points
    May 15, 2018 @ 08:42
    Ivan
    0

    Hi Alex.

    Nope.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies