November Happy Hour will be moved to Thursday December 5th.

Find Page references in XHTML String

Vote:
 

I have a page which has a property of type XHTML String. Contributors drag other pages in this area. If this page is expired or deleted, is there a way to find out if its referered in xhtml string.

Typically EpiServer prompts deleting a content if it is referenced somewhere but I am assuming that doesn't happen if the page is in xhtml editor string. Any ideas or thoughts on this?

#216462
Feb 07, 2020 3:51
Vote:
 

Hi Dileep,

I think you can find it in the "Link Status" Report.

FYI - Before checking the "Link Status". Please make sure that you ran the "Link Validation" scheduled job. And this report also contains all broken links but it will give you some kind of starting path from where you can filter this list.

One more thing it is also giving the page uses while deletion.

#216498
Edited, Feb 07, 2020 8:56
Vote:
 

Hi Dileep,

Links within XhtmlString properties are tracked in Episerver so, if you try to delete a page which is referenced in an XhtmlString property, you will get a message telling you the content which references it. This is by virtue of the fact that XhtmlString properties implement the IReferenceMap interface as described here.

You can programmatically access these links (either "all content referenced by page x" or "all content which references page x") by getting an instance of IContentSoftLinkRepository and calling the Load method.

#216506
Feb 07, 2020 11:41
Vote:
 

I am going to accept both answers here as one answers my question and other gives me a direction on what I am looking for. I basically was looking for a way to identify all items or content a page references so that I could do somekind of clean up of expired content being referenced.

So I don't get a 404 when a user clicks on these expired links referenced in XHTMLProperty. Is there a suggestion on how to do this ?

#216548
Feb 10, 2020 1:43
Vote:
 

I am going to point you in a slightly different direction here.

Based on what you are looking to do, it might be handy to get a list of pages about to expire and be notified in advanced. You can then be more creative with this approach by using Paul's solution above.  

Good luck!

#216597
Feb 10, 2020 17:02
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.