Skip to main content

Deploy customized promoted link list

I needed to create a custom list based on the promoted link list. When I tried to add the list using Visual Studio I could not find a way to create a list template based on promoted links. I could only create list instances based on promoted links. That would have been ok if I did not need to add my own fields. Since I am using sand box solution and trying to make it non-code, I would have to find a declarative method to do this.

I then tried to find the content type that promoted link is based on, but to my surprise, it is based a hidden content type called “System”. All the fields are defined in the list content type. Therefore, I could not create a custom content type based on any site content types.

Then I got the idea of setting it up in a temporary team site and then export it as a template. Doing this would make so I could see how the exported WSP handled the promoted list. After importing the WSP into Visual Studio I was able to get a List Template for setting up the promoted links list.

Here are the result of doing this:

First, I setup a temporary team site, then added a promoted link list, then and called it “Promoted List item”.

I exported the site by storing it as a template, and downloaded the template WSP file.

When I Imported the WSP in visual studio I just selecting the list, Visual Studio will find the dependencies and ask you to include them after clicking “finish”.



The imported WSP project looked like this: 


Then I copied the list template files form the import Visual studio project in the project in my solution, and included in the project. 



I left out the field definitions and the property bag entries thinking that the “Team collaboration lists” feature includes that. and was left with only the list template.


Now I could add the custom fields.





Then making sure my feature was dependent on the "Team collaboration lists" feature. And I was god to go. 

Comments

Popular posts from this blog

CSOM System Update that does not update minor version number

I was in a scenario where I had to do a add some data to a document list in a web job. My issue was that I could not find any system update method in the CSOM API. After searching it i found a blog post showing that one could just override the system fields, like Modified and Editor(Modified My). That seemed to work but that did not stop it form updating the version number of the document. This example will only work for minor unpublished version. I have not found a way to do this without a published version. There it will get a new minor version. The solution combines the use of adding Editor, and Modified with the use of the ValidateUpdateListItem metod. I found that one can set the item values on the item and just set one value in the form value list, then it will update all the fields. If one then set the "bNewDocumentUpdate" it will not update the version number if it is a minor version. So what i do is just get the values from the item before an update, then sets...

The future of sandbox solution

Probably old news, but I was wondering what will replace SandBox solution. Because how else would we deploy stuff to SharePoint Online without WSP's, After some searching on the net I found this blog entry on SharePoint dev blog (link below). That states that the managed code part of SandBox solution is going to be removed, not the declarative parts like content types, lists, modules, etc, This will still be supported in what they call a no-code SandBox Solution (NCSS). I must say that it is nice to know that you can still use the ok part of the SandBox solutions, https://www.blogger.com/blogger.g?blogID=921264504943302831#overview/src=dashboard