Tag Info

Hot answers tagged

3

You can, however it'll require adding code to the parent page and utilizing window.postMessage(). You will have to add an event listener on the parent page to listen for the message, and then open the dialog: window.addEventListener("message", receiveMessage, false); var receiveMessage = function(event) { if (event.origin !== "your app") return; ...


3

As Pradip has already told the reason for this behaviour I won't repeat it here again. But there are a couple of things you can try. Have a look at this article, Inconvenient Content Query Web Part and server-relative URLs, which suggests - Another way to get around this issue is to use a Feature Receiver. After activating the Feature that provisions ...


2

The rules for when to Dispose SharePoint object unfortunately aren't simple. The overall principle is that object use create using new or by enumerating should be disposed and object which are simple references from an existing should be left alone. But as this is SharePoint development (and if it was easy everybody could do it) there is a number of ...


2

I'm also relatively new to SharePoint development, but will try share some of my experience. :) When I created new code/functionality to a site, I make sure that I 'deactivate' the webpart/feature, then under your Admin Settings I retract the solution from the farm. Before I package the solution in Visual Studio, I update both the .feature title and ...


2

Since in SharePoint 2013 CSOM API was introduced SP.Publishing.Navigation namespace, the following example demonstrates how to create a publishing page. How to create a publishing page via SharePoint 2013 JSOM function createPublishingPage(pageName,pageLayout) { var ctx = SP.ClientContext.get_current(); var pubWeb = ...


2

If you enter a URL into the Content Editor Web Part as a relative link, the link converts to an absolute URL when the entry is saved. This automatic conversion can be an issue if you are deploying content from a staging environment to production, where absolute URLs reference the original server's name. To address this automatic conversion issue, You ...


2

If your web part is stored in V3 format (http://schemas.microsoft.com/WebPart/v3) then the following example demonstrates how to get web part property: $path="c:\Search Box.webpart" $propertyName = "Title" #replace to your property name UrlWebPart [xml]$webPart = Get-Content $path $property = $webPart.webParts.webPart.data.properties.property | ...


2

Try appending ?contents=1 to the url. This will take you to the web parts maintenance page. CHeck to see if there are any closed web parts on the page. If so, remove them and you should see the [2] go away.


1

Try this code. It assumes the WebPart title is the ID in the DOM var pageWPArray; function () { for(var i = 0;i < webPartDefs.get_count();i++) { var webPartDef = webPartDefs.getItemAtIndex(i); var webPart = webPartDef.get_webPart(); pageWPArray.push(webPart.get_title()); }); //Loop through your array of Web Parts you'd like hidden for (var i ...


1

If you are open to editing page in SharePoint Designer, then you can use following logic using JavaScript. Place a div tag around the web part <img src="MaximizeImage" id="webpartitleMaximize" onclick="Maximize()"/> <img src="MinimizeImage" id="webpartitleMinimize" onclick="Minimize()"/> <div id="webparttitle"> <!-- ...


1

You can save User data as below string[] userarray = a.CommaSeparatedAccounts.ToString().Split(',');; SPFieldUserValueCollection usercollection = new SPFieldUserValueCollection(); for (int i = 0; i < userarray.Length; i++) { SPFieldUserValue usertoadd = ConvertLoginAccount(userarray[i]); usercollection.Add(usertoadd); } ...


1

Change the path to include reference from 15 hive i.e private const string _ascxPath = @"~/_CONTROLTEMPLATES/15/


1

Before getting to the cause of your issue, let me give you some recommendations for improving your code, because, as it stands, it is hardly readable. Avoid clattering the global scope with unnecessary variables and functions. Look into the module pattern, it will help you keep your code cleaner. You don't really need to use the Function.CreateDelegate, ...


1

I am assuming that you are using your given code and SharePoint 2013 for your question. You are using SPSecurity.RunWithElevatedPrivileges(delegate().. that means you can have full access to the operation which you are performing inside that code blocks, this will use Application pool credentials automatically to perform the operations. Take a look at MSDN ...


1

The web part gallery is a special document library that is located at the root of each site collection. I dont think you can create another custom Web Part Gallery, because this library having direct links with web.config files safe control section. Web Parts are server-side controls that run inside the context of site pages in Microsoft SharePoint ...


1

You can use Content Query Web Part. Then choose the site and library you want to display.


1

The following example demonstrates how to add Content Search Web Part using SharePoint 2013/Online CSOM API Prerequisites: SharePoint Online Client Components SDK var pageUrl = "/Pages/SearchResults.aspx"; var webPartSchemaXml = @"<?xml version='1.0' encoding='utf-8'?> <webParts> <webPart ...


1

You can create your own by using the Search API (or REST) to look at Query Suggestions. https://msdn.microsoft.com/en-us/library/office/dn194079.aspx


1

Use the C# following code to modify the web.config: string content; string WebServiceServer = "example.com"; // <=== your host-name here using (TextReader tr = File.OpenText(bindingFilePath)) { content = String.Format(tr.ReadToEnd(), WebServiceServer); } SPWebConfigModification modification = new SPWebConfigModification("system.serviceModel", ...


1

There is default SharePoint CSS class available that you can use. ms-dialogHidden is the class when you don't want particular div or any element to appear on the dialog. So simply specify extra class to the navigation div ms-dialogHidden.


1

I guess you are trying to insert web part into Rich Text Editor (RTE) of publishing page (e.g., for Body only page layout), in that case the solution would consist of two steps: insert web part into hidden zone template named wpz since the publishing page does not contain any public zone templates insert special marker for web part into ...


1

This error occurs since GetCurrentCtx function is a part of core.js SharePoint library, it is intended for getting context info of XLV web part (ContextInfo object), so: core.js library have to be loaded first it could be executed only in the SharePoint page that contains the instance of XLV web part since ContextInfo object is generated when the XLV ...


1

Copy the out of the box Display Template, rename it and upload it back to SharePoint. Edit the Display Template to point to your desired image. There are many answers to this process here in SE as well as blog posts on the topic. You just have to create a new Display Template.


1

Your WebPart has error's, check the ULS logs, it Says ystem.NullReferenceException: Object reference not set to an instance of an object. at WebPart.CreateChildControls() and so on. You add your webpart in a test Page, and Then attach the (W3Wp)worker process to debug the code, Attach the breakPoint on Load and OnInit method, Then start debugging you will ...


1

Picture Library Slideshow web part In SP2013, there is a check box Show Toolbar use that to hide next previous and pause control



Only top voted, non community-wiki answers of a minimum length are eligible