Kategoriarkiv: File

Copy SharePoint WebDav Address to Clipboard

While configuring SharePoint sites and helping users I often use File Explorer View for editing pages, resources like css and javascript. In IE there is a dedicated button in the ribbon for that. Sometimes it works, sometimes it doesn’t, because of permissions or other restrictions. Anyway, I use Firefox and Chrome while troubleshooting and developing, so I have created a bookmarklet for copying the webdav address of a site that is open in the browser.

Unfortunately, there is no copy function in javascript, the prompt solution plus Ctrl-C works fine.

The bookmarklet:



How to provision a ContentEditorWebPart (CEWP) with predefined content to a page using a module

I did this a long time ago, then when I recently had to do it again, I couldn’t fid any Resources online describing how to do it. Simply adding text to the <Content> tags of the <AllUsersWebPart> declaration didn’t do it. The reason is simple I Think. The content in a CEWP is html, and you need encoded HTML tags for it to show. Otherwise the content will simply be ignored (This is my own theory at least. I haven’t investigated much).

So knowing that you can add any html content. Here is how you add an image for example:

The easiest way to get encoded HTML is to use an Encoder, like this one. Simply paste your html and press encode. Then paste the results inside the <Content> tag for the CEWP. My full code example can be found below. This is to be put inside the File element in a Module:

This works in SP2010 and 2013. Just change the assembly version to 14 or 15 depending on which you are using. I presume it works the same in 2007 also, but I haven’t tried.