Redirect Report
We are trying to find an efficient way to get a list of all of the redirect URLs and the parent page the redirect points to without manually going into the properties of each page. We are using Sitefinity 6.3. Any thoughts/ideas are appreciated, thanks!
Hello Rob,
Would you please provide more information about your needs?
Are you looking for Redirect pages and where they redirects to or additional Urls of the pages?
Regards,
Svetoslav Manchev
Telerik
Hey Svetoslav,
Thanks for your reply! We actually need both I believe.
1) Under Pages or News, if you select to Edit there is the Allow Multiple URL's for this item... we were hoping to capture those URLs in a report without having to go into the Edit screen of each Page or News article.
2) We also were hoping there was a way to pull a report for redirects and the pages they redirect to.
Apologies for me lack of expertise on the system. I'm a new employee and first time Sitefinity user : Thanks!!
Rob
Hello Rob,
You can use the API to get the pages (or any other content you need) and iterate them getting the information you need. For example:
var pNodes = GetPages();
foreach
(var node
in
pNodes)
var urls = node.Urls;
var parentPageName = node.Parent.Title;
var redirectPageNodes = GetRedirectPages();
foreach
(var rp
in
redirectPageNodes)
var redirectsToPageId = rp.LinkedNodeId;
private
IQueryable<PageNode> GetPages()
var nodes = App.WorkWith()
.Pages()
.LocatedIn(Telerik.Sitefinity.Fluent.Pages.PageLocation.Frontend)
.Where(p => p.GetPageData() !=
null
&& p.NodeType == NodeType.Standard)
.ThatArePublished()
.Get();
return
nodes;
private
IQueryable<PageNode> GetRedirectPages()
var nodes = App.WorkWith()
.Pages()
.LocatedIn(Telerik.Sitefinity.Fluent.Pages.PageLocation.Frontend)
.Where(p => p.NodeType == NodeType.InnerRedirect)
.ThatArePublished()
.Get();
return
nodes;