+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Redirect Report

Redirect Report

4 posts, 0 answered
  1. Rob
    Rob avatar
    4 posts
    Registered:
    06 Mar 2015
    06 Mar 2015
    Link to this post
    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! 
  2. Svetoslav Manchev
    Svetoslav Manchev avatar
    735 posts
    Registered:
    07 Dec 2016
    11 Mar 2015
    Link to this post
    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
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  3. Rob
    Rob avatar
    4 posts
    Registered:
    06 Mar 2015
    13 Mar 2015 in reply to Svetoslav Manchev
    Link to this post

    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

     

  4. Svetoslav Manchev
    Svetoslav Manchev avatar
    735 posts
    Registered:
    07 Dec 2016
    18 Mar 2015
    Link to this post
    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;
    }

    and the respective methods:
    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;
    }

    You can do the same for New.

    More information about Pages and News API is available here and here..

    I hope this information helps.

    Regards,
    Svetoslav Manchev
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
4 posts, 0 answered