SOLVED

Intranet & Sharepoint

%3CLINGO-SUB%20id%3D%22lingo-sub-95911%22%20slang%3D%22en-US%22%3EIntranet%20%26amp%3B%20Sharepoint%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-95911%22%20slang%3D%22en-US%22%3E%3CP%3E%3CFONT%20color%3D%22%230000ff%22%20face%3D%22Verdana%22%20size%3D%222%22%3EHello%2C%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%230000ff%22%20face%3D%22Verdana%22%20size%3D%222%22%3EThere's%26nbsp%3Ban%20intranet%20with%20some%20pages%20with%20IFrames%20containing%20sharepoint%202016%20Document%20Lists.%26nbsp%3B%20%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%230000ff%22%20face%3D%22Verdana%22%20size%3D%222%22%3EIf%20the%20document%20list%20has%20a%20folder%20with%20docs%20under%20it%20-%20the%20folder%20won't%20open%20up%20displaying%20the%20documents%20under%20it.%26nbsp%3B%20%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%230000ff%22%20face%3D%22Verdana%22%20size%3D%222%22%3EWhen%20you%20click%20on%20the%20folder%20-%20it%20displays%3A%20%22Content%20cannot%20be%20displayed%20in%20an%20IFrame...%22%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%230000ff%22%20face%3D%22Verdana%22%20size%3D%222%22%3EWhen%20you%20click%20on%20a%20document%20%2Cnot%20under%20a%20folder%2C%20in%20the%20document%20list%2C%20it%20displays%20correctly%20in%20the%20program%20that's%20supposed%20to%20open%20it.%26nbsp%3B%20(Like%20Acrobat%20reader%20or%20Word...)%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%230000ff%22%20face%3D%22Verdana%22%20size%3D%222%22%3EI've%20tried%20mapping%20a%20drive%20to%20get%20around%20the%20security%20but%20it%26nbsp%3Bhasn't%26nbsp%3Bworked.%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%230000ff%22%20face%3D%22Verdana%22%20size%3D%222%22%3EWorking%20with%20Sharepoint%202016%20and%20Office%202013%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%230000ff%22%20face%3D%22Verdana%22%20size%3D%222%22%3EThe%20following%20code%20is%20in%20the%20page%2C%20on%20the%20intranet%2C%26nbsp%3Bwith%20the%20IFrame.%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%230000ff%22%20face%3D%22Verdana%22%20size%3D%222%22%3E%26lt%3B%3C%2FFONT%3E%3CFONT%20color%3D%22%23800000%22%20face%3D%22Verdana%22%20size%3D%222%22%3Emeta%3C%2FFONT%3E%3CFONT%20color%3D%22%23ff0000%22%20face%3D%22Verdana%22%20size%3D%222%22%3Ehttp-equiv%3C%2FFONT%3E%3CFONT%20color%3D%22%230000ff%22%20face%3D%22Verdana%22%20size%3D%222%22%3E%3D%22X-Frame-Options%22%3C%2FFONT%3E%3CFONT%20color%3D%22%23ff0000%22%20face%3D%22Verdana%22%20size%3D%222%22%3Econtent%3C%2FFONT%3E%3CFONT%20color%3D%22%230000ff%22%20face%3D%22Verdana%22%20size%3D%222%22%3E%3D%22ALLOW-FROM%20http%3A%2F%2FSP1%2Fsites%2FthisSite%2FSitePages%2FtestPage1.aspx%22%3C%2FFONT%3E%3CFONT%20color%3D%22%230000ff%22%20face%3D%22Verdana%22%20size%3D%222%22%3E%2F%26gt%3B%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%230000ff%22%20face%3D%22Verdana%22%20size%3D%222%22%3EThe%20following%20code%20is%20added%20in%20the%20Sharepoint%20page%26nbsp%3B%26nbsp%3B%20%3C%2FFONT%3E%3CFONT%20color%3D%22%230000ff%22%20face%3D%22Verdana%22%20size%3D%222%22%3E%3CALLOWFRAMING%20runat%3D%22%26quot%3Bserver%26quot%3B%2F%22%3E%3C%2FALLOWFRAMING%3E%3C%2FFONT%3E%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%230000ff%22%20face%3D%22Verdana%22%20size%3D%222%22%3EAnd%26nbsp%3Bthis%20in%20the%20script%20area%3A%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%230000ff%22%20face%3D%22Verdana%22%20size%3D%222%22%3E%3CSCRIPT%20src%3D%22%26quot%3B%26lt%3BA%22%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fjquery%2F3.1.0%2Fjquery.min.js%26amp%3Bamp%3Bamp%3Bamp%3Bquot%3B%26amp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Blt%3B%2Fscript%26amp%3Bamp%3Bamp%3Blt%3B%2FA%26amp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Blt%3Bscript%26amp%3Bamp%3Bamp%3Bgt%3B%20%24(document).ready(%20function%20()%20%7B%26amp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bgt%3B%2F%2F%20has%20to%20be%20on%20an%20interval%20for%20grouped%20doc%20libraries%26amp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bgt%3B%2F%2F%20where%20the%20actual%20links%20are%20loaded%20only%20once%20a%20group%26amp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bgt%3B%2F%2F%20is%20expanded%26amp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bgt%3BsetInterval(%20function%20()%20%7B%26amp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bgt%3B%24(%26amp%3Bamp%3Bamp%3Bamp%3Bquot%3Ba%5Bonclick*%3D%26amp%3Bamp%3Bamp%3Bamp%3B%2339%3Breturn%20DispEx%26amp%3Bamp%3Bamp%3Bamp%3B%2339%3B%5D%5Btarget!%3D%26amp%3Bamp%3Bamp%3Bamp%3B%2339%3B_EmpPic%26amp%3Bamp%3Bamp%3Bamp%3B%2339%3B%5D%26amp%3Bamp%3Bamp%3Bamp%3Bquot%3B)%26amp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bgt%3B.attr(%26amp%3Bamp%3Bamp%3Bamp%3Bquot%3Btarget%26amp%3Bamp%3Bamp%3Bamp%3Bquot%3B%2C%20%26amp%3Bamp%3Bamp%3Bamp%3Bquot%3B_EmpPic%26amp%3Bamp%3Bamp%3Bamp%3B%2339%3B%26amp%3Bamp%3Bamp%3Bamp%3Bquot%3B)%26amp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bgt%3B.removeAttr(%26amp%3Bamp%3Bamp%3Bamp%3Bquot%3Bonclick%26amp%3Bamp%3Bamp%3Bamp%3Bquot%3B)%3B%26amp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bgt%3B%2F%2F%20document%20type%20icons%26amp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bgt%3B%24(%26amp%3Bamp%3Bamp%3Bamp%3Bquot%3Btd.ms-vb-icon%26amp%3Bamp%3Bamp%3Bgt%3Bimg%5Bonclick%5D%3Anot(%5BdocumentUrl%5D)%26amp%3Bamp%3Bamp%3Bamp%3Bquot%3B)%26amp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bgt%3B.click(function%20(e)%20%7B%26amp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bgt%3Bwindow.open(%24(this).attr(%26amp%3Bamp%3Bamp%3Bamp%3Bquot%3BdocumentUrl%26amp%3Bamp%3Bamp%3Bamp%3Bquot%3B)%2C%20%26amp%3Bamp%3Bamp%3Bamp%3Bquot%3B_EmpPic%26amp%3Bamp%3Bamp%3Bamp%3B%2339%3B%26amp%3Bamp%3Bamp%3Bamp%3Bquot%3B)%3B%26amp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bgt%3Be.stopPropagation()%3B%26amp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bgt%3Be.preventDefault()%3B%26amp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bgt%3Breturn%20false%3B%20%7D)%26amp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bgt%3B.each(function%20()%20%7B%26amp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bgt%3B%24(this).attr(%20%26amp%3Bamp%3Bamp%3Bamp%3Bquot%3BdocumentUrl%26amp%3Bamp%3Bamp%3Bamp%3Bquot%3B%2C%20%24.trim(String(%24(this).attr(%26amp%3Bamp%3Bamp%3Bamp%3Bquot%3Bonclick%26amp%3Bamp%3Bamp%3Bamp%3Bquot%3B))%20.split(%26amp%3Bamp%3Bamp%3Bamp%3Bquot%3B%3D%26amp%3Bamp%3Bamp%3Bamp%3Bquot%3B)%5B1%5D%20.replace(%2F%5B%26amp%3Bamp%3Bamp%3Bamp%3Bquot%3B%26amp%3Bamp%3Bamp%3Bamp%3B%2339%3B%7B%7D%5D%2Fg%2C%20%26amp%3Bamp%3Bamp%3Bamp%3Bquot%3B%26amp%3Bamp%3Bamp%3Bamp%3Bquot%3B)%20.split(%26amp%3Bamp%3Bamp%3Bamp%3Bquot%3B%3B%26amp%3Bamp%3Bamp%3Bamp%3Bquot%3B)%5B0%5D)%20)%3B%20this.onclick%20%3D%20null%3B%20%7D)%3B%20%7D%2C%20500%20)%3B%20%7D%20)%3B%20%26amp%3Bamp%3Bamp%3Blt%3B%2FFONT%26amp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Blt%3B%2FP%26amp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Blt%3BP%26amp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Blt%3BFONT%20color%3D%22%230000ff%22%20face%3D%22Verdana%22%20size%3D%222%22%26amp%3Bamp%3Bamp%3Bgt%3B%3C%2FSCRIPT%3E%20%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20ideas%3F%3C%2FP%3E%3CP%3EJS%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-97193%22%20slang%3D%22en-US%22%3ERe%3A%20Intranet%20%26amp%3B%20Sharepoint%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-97193%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20Kath%20for%20the%20response.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3ECurrently%20all%20the%26nbsp%3Blibraries%20display%20on%20the%20intranet%20are%20pop-ups.%26nbsp%3B%20The%20only%20thing%20I%20found%20was%20when%20you%20make%20the%20view%20I%20can%20tell%20it%20to%20have%20all%20the%20documents%20not%20in%20folders.%26nbsp%3B%20And%20the%20code%20above%20does%20enable%20all%20the%20docs%20to%20open%20when%20they%20aren't%20in%20a%20folder.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20was%20told%20the%20whole%20intranet%20should%20be%20converted%20to%20sharepoint.%26nbsp%3B%20That%20will%20be%20interesting%20as%20most%20of%20the%20data%20is%20in%20a%20different%20SQL%20server.%26nbsp%3B%3C%2FP%3E%3CP%3ELife%20is%20never%20dull!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20again%3C%2FP%3E%3CP%3EJess%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-97040%22%20slang%3D%22en-US%22%3ERe%3A%20Intranet%20%26amp%3B%20Sharepoint%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-97040%22%20slang%3D%22en-US%22%3Ethis%20is%20a%20common%20problem%20with%20sharepoint%202013%20and%202016%20blocking%20system%20pages%20being%20framed.%20You%20are%20obviously%20aware%20of%20this%20as%20you%20have%20tried%20to%20allow%20framing%20but%20you%20cant%20hit%20the%20specific%20page%20body%20that%20loads%20in%20response%20to%20the%20folder%20click.%20because%20the%20allow%20has%20to%20be%20in%20the%20page%20content%20that%20is%20served%20it%20doesnt%20matter%20what%20you%20put%20the%20the%20parent%20caller%20page.%3CBR%20%2F%3E%3CBR%20%2F%3Etry%20getting%20rid%20of%20the%20frame%20if%20you%20can.%20there%20are%20a%20number%20of%203rd%20party%20popup%20tools%20which%20display%20pages%20without%20framing%20them.%3CBR%20%2F%3E%3CBR%20%2F%3Ethere%20is%20a%20lot%20of%20chat%20in%20the%20community%20about%20solutions%20to%20this%20problem%20with%202013%20and%20they%20should%20all%20apply%20to%202016%20i%20think.%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-97039%22%20slang%3D%22en-US%22%3ERe%3A%20Intranet%20%26amp%3B%20Sharepoint%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-97039%22%20slang%3D%22en-US%22%3E%3CP%3Ethis%20is%20a%20common%20problem%20with%20sharepoint%202013%20and%202016%20blocking%20system%20pages%20being%20framed.%20You%20are%20obviously%20aware%20of%20this%20as%20you%20have%20tried%20to%20allow%20framing%20but%20you%20cant%20hit%20the%20specific%20page%20body%20that%20loads%20in%20response%20to%20the%20folder%20click.%20because%20the%20allow%20has%20to%20be%20in%20the%20page%20content%20that%20is%20served%20it%20doesnt%20matter%20what%20you%20put%20the%20the%20parent%20caller%20page.%3C%2FP%3E%3CP%3Etry%20getting%20rid%20of%20the%20frame%20if%20you%20can.%20there%20are%20a%20number%20of%203rd%20party%20popup%20tools%20which%20display%20pages%20without%20framing%20them.%3C%2FP%3E%3CP%3Ethere%20is%20a%20lot%20of%20chat%20in%20the%20community%20about%20solutions%20to%20this%20problem%20with%202013%20and%20they%20should%20all%20apply%20to%202016%20i%20think.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional 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 (Occasional 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