Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Page Link Example Needed



I am trying to figure out how to use IPageRouteHelper to get the current url a block is on.  I was directed to the page below for PageLink, but the Example section is empty.  Does anyone have an example handy?

Jan 16, 2019 19:45

If you get the IPageRouteHelper service it has a property called ContentLink which is the current page's PageReference. You can then pass this is to the IUrlResolver GetUrl method

Jan 17, 2019 10:32

Thanks!  Yeah, ended up with this.   

        public static PageData CurrentPage =>

        public static string CurrentPageUrl => UrlResolver.Value.GetUrl(CurrentPage);
Jan 31, 2019 15:22
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.