Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

This was something I am more curious about, than a solid programming issue to be solved. Sorry about that in advance.

I noticed that when inserting images into a publishing page's Page Content field, SharePoint is doing something to track changes to that image's file name. I am just curious if anyone know what or how it does it.

If you change the file name in the library, or move it to a different folder in that library, it automatically updates the html link reference on the page it was inserted.

Pretty cool but it gets weirder.

If you manually paste in your own image link HTML code directly into the Edit HTML dialog for an image in your Images library (any library really, this works for documents too), and then go change the name or location, it updates your HTML.

If you change your img tag to point to a file that does not yet even exist, and THEN upload and image with that name, not only will it appear on your page (as expected) but if you update the image name in library, it updates your HTML correctly then too.

By this point the voodoo was too strong for me to fathom how this was possible, since it happens when the file is updated (seemingly), not when the HTML is updated, since you can put the link in first, and then update image name later.

Does anyone know, or have any decent guesses who this is done?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

I think the forwardlinks property of an SPFile is what saves all of the info on where to update when this file changes: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfile.forwardlinks.aspx

As far as how this property get's populated, I am unsure.

share|improve this answer
    
Excellent! I think that is exactly what I wanted to know. The mechanism is less important to me than the existence of that property. –  hitdrumhard May 1 '12 at 15:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.