Goal: I am trying to click a button on a page that sets the 'PublishingPageContent' field on another page with data from a 'Reusable Content' list item.

Problem: Whenever I go to the updated page and check it's source via 'Edit Source' in the ribbon, the span tag that holds the reusable content is stripped down.

Here is my code:

var pageContent = '<span class="ms-rtestate-read  ms-reusableTextView" id="__publishingReusableFragment" contenteditable="false" fragmentid="/sites/testpublish/ReusableContent/4_.000"></span>';

I then set the 'PublishingPageContent' field to pageContent.

Now when I go my updated page, the reusable content is not showing up and it's stripped some of the code out when I view it in 'Edit Source'

Here is the code in 'Edit Source':

<span class="ms-rtestate-read  ms-reusableTextView" id="__publishingReusableFragment"></span>

Any idea why this is happening? Thanks

Your Answer

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

Browse other questions tagged or ask your own question.