Page viewer web part in SharePoint Online/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/2016/2013?

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.

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 sharepoint 2016
page viewer web part SharePoint 2016

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 Only secure content is displayed error in SharePoint online page viewer web part.

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
Page viewer web part not working in SharePoint Online

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:

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.

>