Get the Url of a Sitefinity Page from the Guid
If you are working with the Sitefinity Pages API you can easily retrieve the Id of any page in the system. You might also be working with a custom or intra-site module, which has a static Guid property for the landing page.
The Page object itself only has a UrlName property, which returns only the part of the url for that particular page itself, with no relation to where it actually is in the Sitemap.
Fortunately, there is an extension method in the Telerik.Sitefinity.Modules.Pages that can return the actual full url to the page.
The following snippet demonstrates how you can pass in a Guid and get the full url to the page.
public string GetPageUrl(Guid PageID)
var mgr = PageManager.GetManager();
var pageNode = mgr.GetPageNode(PageID);
Be sure to include the namespace above in your class file.
Latest posts by selaromdotnet (see all)
- Restarting a Specific Azure Web App Instance - January 13, 2021
- Adding Ratings and Reviews to Sitecore Commerce with YotPo - November 13, 2018
- Sourcetree Suddenly Prompting for Github Credentials - February 22, 2018