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
Thanks! Yeah, ended up with this.
public static PageData CurrentPage => ServiceLocator.Current.GetInstance<IPageRouteHelper>().Page; public static string CurrentPageUrl => UrlResolver.Value.GetUrl(CurrentPage);
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?