SOLVED

Intranet & Sharepoint

Copper Contributor

Hello,

There's an intranet with some pages with IFrames containing sharepoint 2016 Document Lists. 

If the document list has a folder with docs under it - the folder won't open up displaying the documents under it. 

When you click on the folder - it displays: "Content cannot be displayed in an IFrame..."

When you click on a document ,not under a folder, in the document list, it displays correctly in the program that's supposed to open it.  (Like Acrobat reader or Word...)

I've tried mapping a drive to get around the security but it hasn't worked.

Working with Sharepoint 2016 and Office 2013

 

The following code is in the page, on the intranet, with the IFrame.

<meta http-equiv="X-Frame-Options" content="ALLOW-FROM http://SP1/sites/thisSite/SitePages/testPage1.aspx" />

The following code is added in the Sharepoint page   <WebPartPages:AllowFraming runat="server"/>  

And this in the script area:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script> $(document).ready( function () {
// has to be on an interval for grouped doc libraries
// where the actual links are loaded only once a group
// is expanded
setInterval( function () {
$("a[onclick*='return DispEx'][target!='_EmpPic']")
.attr("target", "_EmpPic'")
.removeAttr("onclick");
// document type icons
$("td.ms-vb-icon>img[onclick]:not([documentUrl])")
.click(function (e) {
window.open($(this).attr("documentUrl"), "_EmpPic'");
e.stopPropagation();
e.preventDefault();
return false; })
.each(function () {
$(this).attr( "documentUrl", $.trim(String($(this).attr("onclick")) .split("=")[1] .replace(/["'{}]/g, "") .split(";")[0]) ); this.onclick = null; }); }, 500 ); } );

</script>

 

Any ideas?

JS

3 Replies
best response confirmed by js list (Copper Contributor)
Solution

this is a common problem with sharepoint 2013 and 2016 blocking system pages being framed. You are obviously aware of this as you have tried to allow framing but you cant hit the specific page body that loads in response to the folder click. because the allow has to be in the page content that is served it doesnt matter what you put the the parent caller page.

try getting rid of the frame if you can. there are a number of 3rd party popup tools which display pages without framing them.

there is a lot of chat in the community about solutions to this problem with 2013 and they should all apply to 2016 i think.

this is a common problem with sharepoint 2013 and 2016 blocking system pages being framed. You are obviously aware of this as you have tried to allow framing but you cant hit the specific page body that loads in response to the folder click. because the allow has to be in the page content that is served it doesnt matter what you put the the parent caller page.

try getting rid of the frame if you can. there are a number of 3rd party popup tools which display pages without framing them.

there is a lot of chat in the community about solutions to this problem with 2013 and they should all apply to 2016 i think.

Thanks Kath for the response.  

Currently all the libraries display on the intranet are pop-ups.  The only thing I found was when you make the view I can tell it to have all the documents not in folders.  And the code above does enable all the docs to open when they aren't in a folder.

 

I was told the whole intranet should be converted to sharepoint.  That will be interesting as most of the data is in a different SQL server. 

Life is never dull!

 

Thanks again

Jess

1 best response

Accepted Solutions
best response confirmed by js list (Copper Contributor)
Solution

this is a common problem with sharepoint 2013 and 2016 blocking system pages being framed. You are obviously aware of this as you have tried to allow framing but you cant hit the specific page body that loads in response to the folder click. because the allow has to be in the page content that is served it doesnt matter what you put the the parent caller page.

try getting rid of the frame if you can. there are a number of 3rd party popup tools which display pages without framing them.

there is a lot of chat in the community about solutions to this problem with 2013 and they should all apply to 2016 i think.

View solution in original post