Para cambiar la MasterPage de SharePoint por PowerShell tan solo debemos abrir la consola de SharePoint (SharePoint Management Shell) como administradores y ejecutar: $web = Get-SPWeb http://MY_SITE.com $web.CustomMasterUrl = "/_catalogs/masterpage/MY_MASTER.master" […]
Podemos ejecutar funciones JS al final de la carga de la página por medio de JQuery. No obstante, en SharePoint esto no siempre funciona: $(document).ready(function(){ //My code }); Esto ocurre […]
SPSecurity.RunWithElevatedPrivileges(delegate() { using (SPSite site = new SPSite("YOURSITE")) { using (SPWeb web = site.OpenWeb()) { //Obtain the page PublishingPageCollection publishingPages = PublishingWeb.GetPublishingWeb(web).GetPublishingPages(); PublishingPage page = publishingPages.FirstOrDefault(f => f.Uri.AbsoluteUri == "YOURPAGE"); […]
Unpublish and Checkout SharePoint Page: SPSecurity.RunWithElevatedPrivileges(delegate() { using (SPSite site = new SPSite("YOURSITE")) { using (SPWeb web = site.OpenWeb()) { //Obtain the Page PublishingPageCollection publishingPages = PublishingWeb.GetPublishingWeb(web).GetPublishingPages(); PublishingPage page = […]