Copied to clipboard

Flag this post as spam?

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


  • Andrew Unger 45 posts 148 karma points
    May 13, 2020 @ 17:56
    Andrew Unger
    0

    Can you render page name using related links?

    I have related links that I need to render the page name of internal linked pages. I know you can use something like "item.Link" and get the full path of an internal link but is there a way to just get the name of the page? Like if I used .Link I would get something like "/home/products/paint". I want to just get the last part of that link "paint". I know you can use captions but we want to make it easier for content creators so they don't have to fill that out, and it also leaves less room for spelling errors. Any help with this would be appreciated I couldn't find the answer to this when searching online.

  • Alex Skrypnyk 6131 posts 23950 karma points MVP 7x admin c-trib
    May 13, 2020 @ 20:22
    Alex Skrypnyk
    1

    Hi Andrew

    What Umbraco version are you using? Are Value converters disabled in your solution?

    If Value converters are disabled checkout code example from the doc - https://our.umbraco.com/documentation/getting-started/backoffice/property-editors/built-in-property-editors/related-links#mvc-view-example---value-converters-disabled

    You can get picked node with this code:

    var pickedNode = Umbraco.TypedContent(item.Value<int>("internal"));
    

    And the name:

    var nodeName = pickedNode.Name;
    

    Thanks,

    Alex

  • Andrew Unger 45 posts 148 karma points
    May 14, 2020 @ 12:25
    Andrew Unger
    1

    I ended up using a multinode tree picker instead. Thank you for the response and the information I appreciate it!

Please Sign in or register to post replies

Write your reply to:

Draft