Category Archives: SharePoint 2010

Folder custom content type limitations

Recently faced the problem with custom content type folder.

When add publishing controls to you custom content type these fields are not saved and folder is not crated. Apperantly this behaviour is already spotted in SharePoint 2007 and was never fixed (for some good reasons I suppose).

So the solution we used was to inherite not from folder base type (0x120) but from document set content type with id “0x0120D520“.

In this way all publishing fields are possible to include in your custom content type;

Hope this helps,

Andrew Adamich

Add custom link to structural navigation menu

Recently I had to add custom link to structural navigation menu in SharePoint 2013. After searching on over the net I found noting and tried to check what properties should be set inside navigation provider by craeting manually link in SharePoint navigation and checking result with debugger…

Here are properties that should be set to be able to insert custom link node in global navigation provider:

ndParent.Properties["NodeType"] = "AuthoredLinkPlain";
ndParent.Properties["vti_navsequencechild"] = true;

  • NodeType property indicates that the node is a custom link.
  • vti_navsequencechild property makes link to appear inside the navigation provider

Here is a full peace of code to add link:

private void SaveNavigationNode(string title, string url)
if (string.IsNullOrEmpty(title)) return;
if (string.IsNullOrEmpty(url)) return;

var web = SPContext.Current.Web;

web.AllowUnsafeUpdates = true;

// Get the top link bar.
var topnav = web.Navigation.TopNavigationBar;

var existingNode = topnav.Cast().FirstOrDefault(n => n.Title.ToLowerInvariant().Equals(title.ToLowerInvariant()) ||

if (existingNode == null)
var ndParent = topnav.AddAsFirst(new SPNavigationNode(title, url, true)); // Add to collection.
ndParent.Properties["NodeType"] = "AuthoredLinkPlain";
ndParent.Properties["vti_navsequencechild"] = true;
existingNode.Title = title;
existingNode.Url = url;

web.AllowUnsafeUpdates = false;

Hope this helps,

Andrew Adamich

Custom icons for list definition using XML

Recently I had to specify custom icons for the list definition I have created using XML definition in visual studio. Solution is quite easy to implement – just specify your icon path in the XML property of list definition

<Elements xmlns="">

When insert image in a such way you should know that this image will be used on:

  • Site contents page. The size of the icon should be 96×96 px.
  • Content and structure where size of the icon should be 16×16 px.

However, when icon specified in list definition is large one it is also shown as large one in “Content and structure” where it should be 16×16 px.


To solve this you should prepare three sets of images. SharePoint manages itself which image to display. However you should have right naming convention to make it work.

  • Small image (16×16 px) – name should starting with ITImageName
  • Medium image (32×32 px) – name should starting with MGSameImageName
  • Large image (96×96 px) – name should starting with LTSameImageName


  • Name of the icon you try to show should be the same for all three images and only prefix should change.
  • These icons should be deployed in /_layouts/15/images folder (/_layouts/14/images for SP2010). You can have another level Inside this folder to isolate your project’s icons.
  • Name of your icon SHOULD NOT start with on of the following letters: L, M, I because these ones are used for prefix.
  • Icon path specified in the list definition XML file should be small icon path. SharePoint will automatically pick up right size icon when displayed on page.

Here is how it should look like:

Custom icons for list definition

Content and structure

Andrew Adamich