3

we have a sharepoint 2010 webapplication which is extended for anonymous access.

Inside the company we use

http://A (dns record is not public, it works only inside the company)

From outside it's url

http://B

in a content editor webpart when you put this html

<span style="background-image:url('/assets/23.jpg');width:100px;height:20px">...</span>

url portion changes and becomes

<span style="background-image:url('http://A/assets/23.jpg');width:100px;height:20px">...</span>

when you publish this content anonymous users can't access this background-image url.

There are around ~3000 pages like this. I know i can use content link of content editor webpart but this is not the case for now.

I have to find a way to stop content editor webpart changes the relative path to absolute path.

  • Have you tried moving the styles into a CSS file and then linking it inside the content editor? – Amal Hashim Oct 19 '14 at 15:08
1

If you enter a URL into the Content Editor Web Part as a relative link, the link converts to an absolute URL when the content is saved. This is OOTB behaviour in SharePoint.

The only OOTB way to surpass this is by putting your content in a .txt file and using Content Link.
If this is not an option as you say, then javascript might be your only alternative, which might become very complicated very quickly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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