A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
AI OnAI Off
A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
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);
Hello,
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?
https://world.episerver.com/documentation/class-library/?documentId=cms/10/7D323675