Copied to clipboard

Flag this post as spam?

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


  • Brita Curum 9 posts 79 karma points
    Dec 16, 2019 @ 11:01
    Brita Curum
    0

    Custom route

    Hi there,

    I want to build a custom route as follows:

    http://localhost:53162/en/{countryName}/hotel/{hotelName}/special-offers

    to redirect to a custom special offer page.

    However, I am using

    Int32 nodeID   = umbraco.uQuery.GetNodeIdByUrl("/{lang}/{countryName}/hotel/{hotelName}/special-offers")
    

    to return the nodeId which returns me as null since it does not compile the dynamic URL.

    Is there any other way of doing this ?

    Much grateful for your help.

    B.

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Dec 16, 2019 @ 12:53
    Alex Skrypnyk
    0

    Hi Brita

    You need to connect URL with id somehow.

    MAybe use URL rewriting + custom logic or just add the id to the URL as a param.

    Alex

  • Brita Curum 9 posts 79 karma points
    Dec 16, 2019 @ 13:05
    Brita Curum
    0

    Hi Alex,

    Thanks for the reply.

    I managed with returning the URL path dynamically by using the below in my controller:

    Request.Url.AbsolutePath
    

    Thanks again. Cheers :)

Please Sign in or register to post replies

Write your reply to:

Draft