Tag: page

Podemos obtener las propiedades por medio de un control llamado ProfileProperty. 1 Registrar el namespace <!--SPM:<%@ Register Tagprefix="PortalWebControls" Namespace="Microsoft.SharePoint.Portal.WebControls" Assembly="Microsoft.SharePoint.Portal, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>--> 2 Cargar el control <!--SPM:<PortalWebControls:ProfilePropertyLoader runat="server" />--> 3 Añadir una linea por cada propiedad (Mantenemos la clase Out-of-the-Box ms-hide para ocultarlas) <!--SPM:<PortalWebControls:ProfilePropertyValue CssClass="ms-hide" PropertyName="MY_PROPERTY_NAME" ApplyFormatting="False" runat="server" ShowPrivate="True" PrefixBrIfNotEmpty="False" />--> Nota: En […]
A través de esta función podemos obtener la URL para ver las propiedades de un item de una lista de SharePoint: public static string GetItemPropertiesURL(SPListItem item) { string web = item.Web.Url; string listID = item.ParentList.ID.ToString(); string contentType = item.ContentTypeId.ToString(); string itemID = item.ID.ToString(); string url = web + "/_layouts/listform.aspx?PageType=4&amp;ListID={" + listID + "}&amp;ID=" + itemID […]
Normalmente suele producirse cuando desplegamos una columna de sitio errónea y la modificamos. Para resolverlo debemos buscar ese campo en la base de datos de contenido y borrarlo. Lo encontramos con: SELECT * FROM [CONTENT_DB].[dbo].[ContentTypes] WHERE Definition Like '%COLUMN_GUID%' Y lo borramos con: DELETE FROM [CONTENT_DB].[dbo].[ContentTypes] WHERE Definition Like '%COLUMN_GUID%' En ambos casos debemos escribir el […]
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" $web.MasterUrl = "/_catalogs/masterpage/MY_MASTER.master" $web.Update() También podemos crearnos un fichero “.ps1” para tener el script guardado y ejecutarlo (Siempre como administrador).
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 porque aveces el document ya está cargado pero SharePoint todavía sigue cargando elementos. Para evitarlo, podemos insertar nuestra funcion en la lista de funciones que […]
When a page is loaded in a Modal Dialog, its URL ends with “IsDlg=1”, that means that it’s being opened in a SharePoint PopUp. If you need to hide some elements when that happens (e.g. hide master page elements) you need to add a new class to these elements: Adding class “ms-dialogHidden” to an element […]
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"); if (page != null) { //Allow modifications bool webAllow = web.AllowUnsafeUpdates; web.AllowUnsafeUpdates = true; SPFile file = page.ListItem.File; //Delete file.Delete(); //Restablish default permissions web.AllowUnsafeUpdates = […]
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 = publishingPages.FirstOrDefault(f => f.Uri.AbsoluteUri == "YOURPAGEURL"); if (page != null) { //Allow file modifications bool webAllow = web.AllowUnsafeUpdates; web.AllowUnsafeUpdates = true; SPFile file = page.ListItem.File; //Unpublish […]
My case: It’s a standard register form created in a SharePoint WebPart (but this error could happen even if you’re not using SharePoint). When I submit the form, sometimes I loose the information of DropDowns (but not the information of textboxes) and it seems to happen randomly. I checked the packages sent with Wireshark and […]
If we couldn’t acces to the menu item “Edit Page” for any reason and we want to edit that page (e.g. to remove some webpart that blocks our page) we’ve to add one parameter at the end: contents=1 Then, the URL would be like this: http://misyte.com/mysubsite/Pages/default.aspx?contents=1 By dong this we’ll access to a standard SharePoint […]