1

I have some common content as Site Pages, lets call it "Page 1", which I want to show in "Page 2" and "Page 3", just as it is shown in Page 1, so that I can just update Page 1, and Page 2 and Page 3 will start showing the updated content. All pages have simple HTML Content.

I can see it has to do something with Web Parts. But for the love of my life, i am not able to achieve this.

Please note that I am using enterprise SharePoint 2013, so if there is a setting that can block me for achieving the above, please let me know, so that I can get it corrected.

1

4 Answers 4

1

If you are adding the simple content using HTML and content editor webpart, I will suggest you the below approach:

  1. Write all your code in single HTML file.
  2. Save it in site assets/style library.
  3. Add content editor webpart on all 3 pages.
  4. Reference the HTML file from site assets/style library (like given in below image).
  5. Whenever you will make any changes in HTML file and re-upload in site assets/style library, all 3 pages will be updated and show same content.

enter image description here

References:

  1. Content Editor Web Part
4
  • I uploaded the HTML, which opens fine in the browser. But when I put the path in the Content Link, it did not show anything. The Content Editor showed blank.
    – Heat Waves
    Mar 24, 2020 at 15:23
  • Are you saying that it is working on page 1 and not working on page 2?or is it not working on either of the pages? Mar 24, 2020 at 15:56
  • I think there is a little confusion. "Page1.html" is a simple html in my Site Contents folder. Which I have put in "Page2.aspx" as Content Editor in the Content Link field - As shown above in your reply. When I click Apply or Okay, or even save Page2.aspx, the Content Editor frame shows blank. Am I doing something wrong in saving the Page1.html file in Site Contents, when I click on the Page1.html file in Site Contents folder, it downloads the file instead of displaying the content.
    – Heat Waves
    Mar 24, 2020 at 16:35
  • I think you are doing it right. Just check the path your providing to your HTML file is correct. Also, after adding the webpart and saving the page, check if there is any error in browser console. Mar 25, 2020 at 4:51
1

If I am understanding you correctly, you want to place the same HTML content on multiple pages. It sounds like you are half-way there when you mentioned a Content Editor. Quite simply, you can save your HTML file wherever you’d like in your SharePoint site (like in a document library, perhaps). Then copy the URL to that HTML file to your clipboard. Edit a SharePoint page (i.e., page 2, page 3, etc.) and add a web part -> content editor. Finally, all you have to do is edit the content editor by clicking the down arrow at the top right corner of the content editor. At the top right of your screen you can paste in the link to your HTML file in the section called “Content Link”, then click Ok/Apply and stop editing the page.

You can repeat this process on other pages...or, pro-tip - in the edit page mode, you can click the arrow at the top right of the content editor web part and click “Export.” This allows you to save the web part (with the link to your HTML content). On other pages, when your are ready to add the content editor, instead you can upload the web part, then add to your page.

Hope this helps! We use this to embed HTML across about 100 SharePoint pages, and we can simply update the one HTML file to update all of the pages.

Edit: Depending on how you want to implement this, Ganesh’s post below is helpful, too. You could use a Page Viewer web part instead of a content editor if you would like to place the external HTML page within an iframe.

9
  • Hi Andrew, Thank You for the reply.
    – Heat Waves
    Mar 24, 2020 at 14:38
  • I tried doing the steps, but the content editor is not showing any thing. A little more information: The HTML File I have uploaded, I used an existing Site Page (Page 1) and used Edit Source and wrapped it around with <html> </html>. Uploaded this HTML file in the Site Assets. Then I added the content editor in Page 2 and in the Content Link, add the path for the html.
    – Heat Waves
    Mar 24, 2020 at 15:05
  • Hmm, so are you saying you took the source HTML from "Page 1.aspx" and just added <html> and </html> tags to it? If so, I do not think that would work since SharePoint aspx pages are built/wrapped with various objects to create all of the ribbons, headers, etc. Even if it did work, you would see all of the banners and headers twice (one inside of the other). Can you post your HTML file to this thread? Mar 25, 2020 at 12:18
  • The HTML opened fine in a browser (just has a 2 tables with 3/4 rows each). Cannot paste the entire code due to text limit -
    – Heat Waves
    Mar 25, 2020 at 20:01
  • <html> <table width="100%" class="ms-rteTable-default" cellspacing="0"> <tbody> <tr> <td class="ms-rteTable-default">Lorem</td> <td class="ms-rteTable-default"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit &#160;voluptate velit esse cillum.</p> </td> </tr> <tr> <td class="ms-rteTable-default">Ipsum</td> <td class="ms-rteTable-default"> <p>voluptate velit esse cillum.</p> </td> </tr> </tbody> </table> </html>
    – Heat Waves
    Mar 25, 2020 at 20:01
0

For this scenario, you can use page viewer webpart.

What is Page viewer web part in SharePoint?

The page viewer web part is used to display the webpage, file or the folder inside a WebPage. Once we place the Page Viewer web Part in a site Page, it automatically inserts the HTML IFrame Element.

How to add the page viewer web part?

To insert the Page Viewer Web part , we need to follow the below steps.

  1. Click on the Edit Page on a Site Page Where you want to insert the page viewer Web Part
  2. Select Page Viewer from Media and Content  of Categories Section
0

You could insert embed code in the page2

enter image description here

And type the embed code as below:

<iframe src="http://spsite/pages/page1.aspx" style="width: 1000px; height: 500px;"></iframe>
2
  • Hi, This seems to be working. But the only issue is that the aspx page is coming with a bunch of extra navigation and tool bars, the same way the link opens. Is there a way to suppress everything else but content? I would be grateful, if you can share the process of eliminating these extra parts (which are common for all Site Pages), when I embed it in different pages.
    – Heat Waves
    Mar 24, 2020 at 15:22
  • Update: I found a way to suppress them using Java script. But it is very cumbersome. If nothing else works, I will go that way. Cannot believe it is so difficult, when it should have been a straight forward configuration in SP to show comment content from other Site Pages.
    – Heat Waves
    Mar 24, 2020 at 17:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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