Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Hi!
How do you mean internal link? You mean the link used in CMS edit mode or the permanent link?
/Q
I'm assuming you want to check if your link points to an internal page or an external URL.
The URL property type doesn't have a method for checking that.
I think the closest you can get is to check if link.Host matches your siteUrl.
I know this is old but you could use @Url.IsLocalUrl(link.Href) to check if a link is internal.
Hi!
I have a property of type Url, and I want to check if it is internal or external. How do I do that?
Url link = CurrentBlock.RelatedInfoLink;
link.?