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.
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.
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
@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.
is working on a reply...