Tag Info

Hot answers tagged

7

Try the following powershell code, $site = new-object Microsoft.SharePoint.SPSite("http://Server:1111/") $web = $site.OpenWeb("/") $resultsPath = "Pages/default.aspx" $page = $web.GetFile($resultsPath) $page.CheckOut() $wpm = $web.GetLimitedWebPartManager($resultsPath, [System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared) $wpm.WebParts | ft ...


5

I think what the OP is after is a way to store information that can be made accessible globally. If it is indeed the case, then what can serve this need are property bags. Property bags are a place to store metadata or properties of your SharePoint sites. The Property Bags are implemented as a hash table consisting of property names and values; they can be ...


5

How to add WebPart client object on page via JSOM function addWebPart(webUrl, pageUrl,webPartXml,zoneId,zoneIndex, Success,Error){ var context = new SP.ClientContext(webUrl); var web = context.get_web(); var file = web.getFileByServerRelativeUrl(webUrl + pageUrl); var webPartMngr = ...


5

You can add a simple label inside of your web part like: <asp:Label runat="server" ID="LabelWelcome"></asp:Label> And in the page load method in code behind set the text of that label like: this.LabelWelcome.Text = "Welcome " + SPContext.Current.Web.CurrentUser.Name; Then just set Chrome Type property to None in web part settings, so web part ...


4

.webpart files are XML. Open it with Notepad or your favorite XML editor. See Web Part Properties - part 3 - the .webpart file by Wictor Wilen for an example.


4

Create a new page layout based on the Enterprise wiki but including your web part. This page layout can then be used by all your Enterprise wiki sub-sites. The simplest way is probably to copy the existing Enterprise wiki page layout in the first instance. You will need to use something like SharePoint Designer to achieve this.


4

That is simple. Do not have two references to jQuery in your webparts. Load jQuery only once. What happens is that a new jQuery overrides all the extensions... Consider this. Every js code declared as <script> is loaded synchronously. Web Part 1 loads jQuery and fancybox. Fancybox is an extension of jQuery. Web Part 2 loads jQuery again, and ...


4

you can use PowerShell script to upload your dwp file to web parts gallery. $urls = { "url1", "url2", ..., "url60" } $srcPath="c:\temp" $libraryFolder="_catalogs/wp" foreach($url in $urls){ $libraryUrl=$url + "/" + $libraryFolder UploadFile $srcPath "your.dwp" $libraryUrl $libraryFolder }


4

This code iterates all sub folder of your root folder and gets items by your query from subfolders foreach (SPFolder subFolder in docLibrary.RootFolder.SubFolders) { SPQuery oQuery = new SPQuery(); oQuery.Query = "Your Query" oQuery.Folder = subFolder; collListItems = oList.GetItems(oQuery); ...


4

I've successfully done this in SP 2010 with PowerShell. I've done things slightly different, so let me try to translate and see if it works out for you. Adding a Web Part to a WebPartZone For your first section, add an .Update() on the page creation to commit the change to the DB: PublishingWeb pWeb = PublishingWeb.GetPublishingWeb(web); string pageName = ...


4

The doctype of the default master pages isn't for HTML5 so I doubt it, you would need to set up a new master page (even a duplicate of the built in ones) with the correct doctype to use HTML5. You also have to then be wary of the CSS implementation as the master page normally forces IE10 compatibility but this could be resolved when you create your HTML5 ...


4

Here is a way to do it in sharepoint 2013 in visual studio 2012 1)Create a empty sharepoint 13 solution Farm solution . 2) Add a sharepoin 13 project into it . 3)Add a mapped foder "Resources" to the project . 4)Now you gonna add three resources one for english "testMutliLing.en-US.resx" and one for german "testMutliLing.de-DE.resx" and one default ...


4

Don't worry. The pure use of CreateChildControls is only due to old habits of SharePoint developers due to the way Web Parts was developed in the past. If you prefer to build your web parts declaratively due to the increased productivity then just use that method. The only reason to prefer CreateChildControls is if you need the extra flexibility of adding ...


4

In order to view the Closed Web Parts, you just need to do: "Add Web Part" in any Web Part Zone Search for the "Closed Web Parts" category in the Web Part selection menu that appears on the Ribbon Your closed web parts should be right there


3

Well you can do it ,but you will need to write all your code, and create the structure for the webparts yourself. If you use Professional or Ultimate you will have access to the SharePoint templates that will greatly improve your developing experience when for example creating apps. If you want to use Express you would need to reference the ...


3

Okay let's go over everything to do with WebParts see what you are missing out 1) Types: .DWP is version 2 webparts .webpart is version 3 webparts Reading the dwp/webpart file will tell you the version of the webpart even if the extension is wrong xmlns="http://schemas.microsoft.com/WebPart/v2" Once you have determined this then you need to enter your ...


3

For displaying pictures in Slideshow web part, web images (stored under /_w folder in Picture Library) are used and not the original images. Unfortunately it is not supported to configure in web part what image type (original, web or thumbnail) should be displayed in Slideshow. The solution described below allows to display original images (without ...


3

I went a little different direction to fix this problem before. I created a special webpart which allowed you to configure it to create a blog post as another user. Here is the meat of the code to accomplish that: //UserId = string of full login name of manager/person you want the blog to be created by //listView = SPView of the blog using (SPWeb listWeb ...


3

You can insert the following JavaScript into the page can be in a Content Editor Web Part or what you want: <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> <script> jQuery.noConflict(); jQuery(document).ready(function($){ var daynum = new Date().getDay(); var dayArray = ["Sunday", "Monday", "Tuesday", ...


3

Inspired by this post: http://sharepoint.stackexchange.com/a/36311/17191 I finally got it to work. After: SPList list = web.Lists.TryGetList("Messages"); I've added the line: SPContext renderContext = SPContext.GetContext(HttpContext.Current, null, list.ID, web); and now anonymous user can access a site with this control (without actually having any ...


3

There are two possibilities to get the ThemedImageUrl of the spcommon.png File. You can use C# Code and the Method GetThemedImageUrl() which was allready mentioned. But SharePoint 2013 also provides a new Control called ThemedForegroundImage. Take a look how to use it: <SharePoint:ThemedForegroundImage ThemeKey="spcommon" ...


3

What you could do, is to use for example jQuery. There are elements lower down in the structure that has unique (well unique for all List View Webparts) classes. Ex. $('.ms-listviewtable').closest('.ms-webpart-chrome').addClass('tada-listview-webpart') That code adds the class tada-listview-webpart to the most outer element of a List View Webpart. By ...


3

Add your Content Editor WebPart Set Chrome to None Add HTML like this: <div class="ms-comm-adminLinks ms-core-defaultFont ms-noList"> <div class="ms-webpart-titleText"> My Web Part </div> <ul class="ms-comm-adminLinksList"> <li class="ms-comm-adminLinksListItem"> <a class="ms-link" ...


3

You need to populate the gallery if web part is not appearing in the web part gallery. For that go to site setting(I use 2013) site gallery, click on web parts link There clicking on new documents, you will get all the web parts installed. Check the box along the web part name and click on populate button on the top. That should work, I hope.


3

We can do it using Client Object model, to do it, we need the xml file of the webpart you need to add. You can get it by the following method, Step 1: Goto Site settings-> Web part Gallery. Step 2: Then choose the needed web part, click edit -> click view XML -> copy the XML, then put it in the below code. ClientContext clientcontext = new ...


3

Add a Content Editor Web Part and use basic HTML - Tables/Divs, etc <table id="My4x4ImageGrid"> <tr> <td id="Col1Row1"><a href="url-01"><img src="image-01"></a></td> <td id="Col2Row1"><a href="url-02"><img src="image-02"></a></td> <td id="Col3Row1"><a ...


3

The configuration panel of the web part is called Tool Pane and you can open it using this simple JavaScript snippet : lblErrorMessage.Text = "<a href=\"javascript:MSOTlPn_ShowToolPane2Wrapper('Edit', this,'" + this.Parent.ID // Id of the current webpart + "')\">Edit Web Part</a>"; this.Parent.ID : return the WebPart ...


3

It is strongly recommended not to create any custom web parts for a such cases. FAQ SharePoint List Create SharePoint List for storing FAQ entries (for example, rename the Title column to Question, add column of type Multi-Line Text and name it Answer) Display FAQ items Probably the simplest way for displaying FAQ items would be to modify the default ...


3

Can a single web part be a provider and consumer? Yes Can you do web part connections without postbacks? Sort of. You can use UpdatePanels to do partial page postbacks Can you chain web part connections? I don't think so. As far as I know there is no way to indicate the order in which connections should be processed. In the example you gave the web part ...


3

The options at your disposal depend on if you are running the Enterprise SKU or one of the supported O365 plans. Generally speaking - if you are using Page layouts you already have Publishing Features Enabled (however since we may also be talking about web part pages I'll cover both) You have the option to use the Design Manager functions for publishing ...



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