I have created list items links. When user clicks on them, the DispForm.aspx gets opened as a modal popup. I want to hide the ribbon that comes on the top. I have used javascript code to open list items as a modal popup. Please suggest how to hide the list ribbon using javascript.
1 Answer
add this CSS to the page you want to open as modal
/* hide ribbon in modal dialog window */
.ms-dialog #s4-ribbonrow {
display: none;
}
-
-
@Ruchi you wont need javascript just add the above code to css in your page which you are opening as modal popup Commented Mar 19, 2015 at 9:13
-
function popup_broadcast(ID) { var options = SP.UI.$create_DialogOptions(); options.width = 1200; options.height = 800; options.url = "/Lists/News%20%20Broadcasts/DispForm.aspx?ID=" + ID; options.dialogReturnValueCallback = Function.createDelegate(null, success); options.showClose = true; SP.UI.ModalDialog.showModalDialog(options); } This is my code that opens list item that are coming as hyperlink in a modal popup.Where should I put that css?– RuchiCommented Mar 19, 2015 at 10:52
-
open your page in SharePoint designer, edit it with advance mode, you will find "<SharePoint:StyleBlock runat="server"> </SharePoint:StyleBlock>" tag just paste it inside that tag Commented Mar 19, 2015 at 11:13
-
WC.. you can just mark it as answer for future reference Commented Mar 20, 2015 at 9:04