Page viewer web part in SharePoint Online/2019/2016/2013

This SharePoint tutorial explains the Page viewer web part in SharePoint Online or SharePoint 2016/2013/2010. We will see what is a page viewer web part in SharePoint? How to add and configure a page viewer web part in SharePoint Online/2019/2016/2013?

Also, we will see, how to work with Page viewer web part in SharePoint online modern sites.

I have also uploaded a video tutorial on the Page viewer web part in SharePoint or SharePoint page viewer web part.

We will also see, how we can display a file or folder using a page viewer web part in SharePoint.

Page viewer web part in SharePoint online modern site

The page viewer web part in not available in SharePoint online modern sites in office 365. But we can use the below two web parts which will work like a Page viewer web part in SharePoint.

  1. SharePoint modern Embed web part
  2. SharePoint modern Link web part

Modern Embed web part

In SharePoint Online modern sites, we can use the embed web part to display a page, here is how you can try.

Edit the page where you want to add the embed web part, then click on add web part and search for embed.

Page viewer web part sharepoint online modern
Embed web part in sharepoint

But the embed web part does not allow us to provide an URL directly, if you will try it will show error as:

This website doesn’t support embedding using just the address. Try pasting the embed code instead. If it’s important to embed from this site using just the address, please send us feedback.

This website doesn't support embedding using just the address
This website doesn’t support embedding using just the address

To fix the above error, instead of directly providing the URL, we need to generate the embed code like below:

You just need to provide the page URL in the src attribute like below:

<iframe src="https://www.spguides.com/" width="100%" height="500px"></iframe>

When you will add the embed code like above, it might show an error like below:

Embedding content from this website isn’t allowed, but your admin can change this setting. They will need to add ‘www.spguides.com’ to the list of sites that are allowed.

Embedding content from this website isn't allowed
Embedding content from this website isn’t allowed

To fix the error, “Embedding content from this website isn’t allowed, but your admin can change this setting“, follow the below steps:

Step-1:

Open the SharePoint site setting page, Click on Settings icon -> Site Information -> View all site settings. Or you can access the site settings page directly from the URL.

https://tsinfotechnologies.sharepoint.com/sites/SPGuides/_layouts/15/settings.aspx

Step-2:

Then click on “HTML Field Security” that is presented under “Site Collection Administration“.

Step-3:

In the HTML Field Security page, add your domain name like below and click on OK.

Page viewer web part sharepoint online modern site
Embedding content from this website isn’t allowed

Now when you will add the embed code in the SharePoint Online modern site embed web part, it will display the page, no error will come.

sharepoint online modern page viewer web part
sharepoint online modern page viewer web part

This is how we can display a page in SharePoint online modern sites.

Link web part

Unlike SharePoint modern embed web part, by using the modern link web part, you can provide the link directly (external URLs also). But instead of displaying the page completely, it will display as a link.

sharepoint online modern link web part
sharepoint online modern link web part

This is another way, we can use the link web part to display a page in SharePoint Online modern site.

Video on Page Viewer Web Part in SharePoint

Watch a video tutorial on Page viewer web part in SharePoint. If you like our videos, Subscribe to EnjoySharePoint YouTube Channel.

Page viewer web part in SharePoint

SharePoint Page Viewer Web Part is an out-of-box web part provided by Microsoft. By using this web part you can show a web page, file, or folder on a SharePoint Page.

You can use the page viewer web part only in a browser that supports the HTML IFRAME element. And you can display a file or a folder in Internet Explorer. The Page Viewer Web Part displays content asynchronously from the rest of the page.

SharePoint page viewer web part configuration

We can easily add a page viewer web part to a classic SharePoint web part page.

Note: In modern SharePoint pages, you can not add this page viewer web part. Know more about SharePoint Online modern experience.

To add page viewer web part in a page, Open SharePoint site and then Edit the page and then click on Add a Web Part. Then from the Web Part categories Select Media and Content. From the Media and Content Web Part categories select Page Viewer web part. Then click on Add.

sharepoint page viewer web part
SharePoint page viewer web part

Once you will add the web part now you can configure the web part by clicking on open the tool pane link on the web part. Once you will click on open the tool pane link, the Page Viewer properties dialog will open.

sharepoint online page viewer web part
SharePoint online page viewer web part

From the first section, you can choose from radio button list what you want to display like Web Page, Folder or File. Suppose you will select the Web Page, then in the Textbox put the URL of the webpage as shown in the figure below.

page viewer web part
page viewer web part

Now the Web Page will appear inside the Page Viewer web part. You can also set all the other properties for the web part like here I have changed for width and height.

The page looks like below:

page viewer web part sharepoint 2013
page viewer web part SharePoint 2013

Below is how it appears when I give a SharePoint Online document library URL.

page viewer web part sharepoint online
page viewer web part in sharepoint online

If you are providing any SharePoint web page, file, or document library URL then you can use an absolute URL or a relative URL.

How Page Viewer Web Part displays a Web page in a SharePoint page?

The linked content of the SharePoint Page Viewer Web Part is isolated from other content on the page by the HTML IFRAME element. The Page Viewer Web Part in SharePoint Online displays content asynchronously from the rest of the page. This means that you can view and use other Web Parts on the page if the link happens to take a long time to return the content.

This element ensures that any HTML elements that are displayed as content in the Page Viewer Web Part do not conflict with other HTML elements on the page.

SharePoint Online: Page Viewer Web Part Not Working

Sometimes, when you add a page viewer web part in SharePoint Online, it will not render the content in the SharePoint web part page. If you are seeing a warning message like Only secure content is displayed at the button of the browser window, then you can follow the solution below.

Apart from this, you can check if “custom script” is enabled in the Office 365 SharePoint Online admin center. You can verify that from the SharePoint Online admin center Settings page like below:

Page viewer web part not working in SharePoint Online
sharepoint page viewer web part not working

SharePoint page viewer web part file path

If you are trying to give a file path inside a SharePoint Online page viewer web part like below, it might not work.

https://onlysharepoint2013.sharepoint.com/sites/Batch12/Shared Documents/Demo-Ppt-SharePoint.pptx

It will give an error like below:

The file name or path is not valid for the link property. Check the spelling and syntax, and then type it again.

the file name or path is not valid for the link property
the file name or path is not valid for the link property

You should give the file path like below in the page viewer web part in SharePoint Online.

file://onlysharepoint2013.sharepoint.com/sites/Batch12/Shared Documents/Demo-Ppt-SharePoint.pptx

Similarly, if you want to give the file path, which is there in a shared drive, you can give the path like below:

\\MySharedDrive\HR Documents\CompanyProfile.pdf

Page viewer web part shows a blank page in SharePoint

Sometimes, if you have added an external URL in SharePoint online page viewer web part, you may see a blank page on it. To solve the issue, you can open the SharePoint site settings page, click on HTML Field Security which is under Site Collection Administration.

Then in the “HTML Field Security” security page, make sure to choose radio button “Allow contributors to insert iframes from any domain“.

Page viewer web part shows a blank page in SharePoint
Page viewer web part shows a blank page in SharePoint

Error Page viewer web part shows a blank page in SharePoint

If you are facing an issue like “Only secure content is displayed” in SharePoint online page viewer web part or the page view web part shows a blank page or SharePoint online page viewer not working, then you can read the below articles to solve the issue:

Only secure content is displayed SharePoint

Let us see, how to solve only secure content is displayed error that comes while using Page viewer web part in SharePoint Online/2013/2016.

Recently I was using the page viewer web part in SharePoint Online site. I was displaying a URL inside the page viewer web part. But in IE it was showing an error as Only secure content is displayed.

And once I click on Show all content. Then only it will show the content from the page viewer web part.

Only secure content is displayed SharePoint
Only secure content is displayed SharePoint

Only secure content is displayed SharePoint

Below are two solutions which you can try to solve only secure content is displayed the warning message.

Inside my SharePoint online page viewer web part, I was trying to show http://www.enjoysharepoint.com URL.

Since SharePoint online site is an HTTPS site and this one is an HTTP site. It was showing that warning message. The page viewer web part URL was like below:

Only secure content is displayed SharePoint online
Only secure content is displayed SharePoint online

When I change the URL to an “https” URL. It started showing the page without the warning message.

SharePoint page viewer only secure content is displayed

The other option is we can disable that warning message in the browser itself. Open Internet Explorer -> On the Tool menu, click Internet Options -> Click the Security tab and then click Custom level -> In the Settings box, scroll down to the Miscellaneous section, and under Display mixed content choose Enable.

It looks like below:

SharePoint online Only secure content is displayed
SharePoint online Only secure content is displayed

I hope this will be helpful to resolve the SharePoint page viewer only secure content is displayed warning message issue in IE.

Alternative ways for Page viewer web part in SharePoint

There are also alternate ways to display content in a web part page without using a SharePoint page viewer web part.

We display content using a SharePoint content editor web part or by using embed code web part.

In content editor web part or embed code web part, you can add the code like below:

<iframe id="iframe1" height="350" width="600" src="https://URL HERE"></iframe>
<iframe src="https://URL HERE" width="600" height="350"></iframe>

You may also like following SharePoint tutorials:

Conclusion

I hope this SharePoint tutorial will be helpful to know the Page Viewer web part in SharePoint Online/2019/2016/2013. We also saw how can we display a file or folder using a page viewer web part in SharePoint Online. SharePoint page viewer web part is really useful to display a page, file, or document.

It must solve the below queries:

  • page viewer web part
  • Page viewer web part sharepoint online modern
  • page viewer web part sharepoint online
  • sharepoint page viewer web part
  • sharepoint online page viewer web part
  • page viewer web part sharepoint online modern
  • sharepoint online page viewer
  • sharepoint page viewer web part not working
>