Copied to clipboard

Flag this post as spam?

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


  • jeff mayer 122 posts 200 karma points
    Mar 17, 2015 @ 21:44
    jeff mayer
    0

    Referencing Node ID URL links with Courier

    Can someone shed some light on how to reference a node id that has been transferred via courier?  Currently I reference a specific node id using the code below. I know this will not working with nodes that have been transferred using courier since the node id can be different.   

     

    Existing sample

    @Umbraco.NiceUrl(1225)

     

    I see a related thread but I am unsure about how to get the GUID.

    https://our.umbraco.org/forum/developers/razor/59288-Getting-Content-by-Guid-in-v7

  • Paul Sterling 718 posts 1534 karma points MVP 8x admin c-trib
    Mar 18, 2015 @ 20:44
    Paul Sterling
    0

    @jeff

    This is in a Razor view?  There's no way for Courier to know which node id should be used on the target instance in this case.  You can, of course, create a custom resolver that would convert the node id from the source on the target instance - check out the docs here https://github.com/umbraco/Courier/blob/master/Documentation/Developer%20Documentation/Data%20Resolvers.md

    But maybe a better solution would be to create your razor in a way that it doesn't rely on a hard-coded node id.  FWIW, a hardcoded GUID can also be different on source and target instances, so that won't solve the issue in this case.

Please Sign in or register to post replies

Write your reply to:

Draft