More in this section

Forums / General Discussions / Link checker

Link checker

2 posts, 0 answered
  1. Devin
    Devin avatar
    149 posts
    09 Jun 2009
    15 Jul 2010
    Link to this post


    Is there a way in Sitefinity to list all pages that are linked to a specific page? Users may want to remove a page but don’t want to create broken links if other pages are linking to it.



  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    15 Jul 2010
    Link to this post
    Hello Devin,

    If you use a single control to add link reference it would not be so hard. You have to loop through pages collection ( CmsManager.GetPages()) and then controls collection searching for a control of a certain type. Then you have to cast the control to ICmsWebControl and call LoadControl(). Afterwords you can access a public property that is used for setting the link and check  whether this page exists or not.

    If you do not use a certain control you have to use the same procedure as above, but loop through all controls and all properties.
    Both the ways will kill your performance and this should be some scheduled service that is executed once a day. The service will send you report with all broken links that you should fix.

    Another option is to implement this on control level and upon saving /editing to check for broken links, but this will consume time, before you need to make a check inside some content or for a given property.

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered