This project is read-only.

BROWSE, PAGE and INSERT NOT WORKING on new masterpage layout. and also Double Ribbon issue

Aug 8, 2014 at 1:49 PM
I have been able to built a masterpage html layout. But the top menu buttons are not working, (BROWSE, PAGE etc) How can I make them to work because, when I use it to make page layouts sharepoint can see it and be able to make up a page layout. If you could advice me on what to do next. Your assistance is greatly appreciated.
Aug 8, 2014 at 3:24 PM
Another question is what do i need to chuck out of the masterpage html layout then, to remove the ribbon?
Aug 8, 2014 at 6:00 PM
The top ribbon buttons should be working OOTB with any of this project's master pages. Did you make any adjustments to the master page, css or js? It is possible that the pages in question are checkout by someone else and this could cause a similar experience, but I doubt that is the issue in this case.

My suggestion, start over with a fresh master page from this package and make sure that there are no JS errors and that all files are problerly linked up.

Regarding your request to remove the ribbon, you do not want to do that, SP needs the ribbon. Do you really just want to hide it for anonymous users?

Eric
Aug 11, 2014 at 6:32 PM
Edited Aug 11, 2014 at 6:33 PM
You can do this (remove the ribbon) with javascript in a content editor web part. You'll need to have jquery and spservices (or use a CDN) and change where I have "Source" in the code to point to wherever you want to get those from.

You can also append "?IsDlg=1" to the end of the URL to hide some of the top portion of the page. I use both of these solutions sometimes to hide everything "sharepoint" and only display the content.

You can read more about this here: https://spservices.codeplex.com/discussions/80847
<script src="/Source/jquery-1.10.2.min.js" type="text/javascript"></script><script src="/Source/jquery.SPServices-2014.01.min.js" type="text/javascript"></script><script type="text/javascript">

$(document).ready(function() {
$().SPServices({
operation: "GetRolesAndPermissionsForCurrentUser",
async: false,
completefunc: function(xData, Status) {
// alert(xData.responseXML.xml); 
var userPerm = $(xData.responseXML).find("[nodeName=Permissions]").attr("Value");
// alert("userPerm = " + userPerm); 
var nonAdminP = (33554432 & userPerm) == 33554432;
// alert("nonAdminP == 33554432: " + nonAdminP); 
var adminP = userPerm == 9223372036854775807;
// alert(adminP); 
var hideEdit = !(nonAdminP | adminP);
// alert("hideEdit = " + hideEdit); 


if (hideEdit) {
//alert("Hide"); 
$("a[title='Edit Item']").parent().parent().parent().hide();
$("td.ms-separator:nth-child(2)").hide();
}
}
});

});</script>