Posts

Showing posts with the label WebPart

Add the Blog template to an existing SharePoint Site

When you want a blog in SharePoint you typically create a Site Colletion or Subsite with the blog site template. In some cases you have created a team site, because of its features. But you want to use the blog features, too. So you need to activate the feature. To do so you need the the SharePoint Management Console - the UI does not allow you activating the feature.

SharePoint 2013 WebPart with custom properties

Image
If you created a WebPart for SharePoint 2013 and you want the user to customize it, you will need properties. Setting them up is not that easy as you think. You need to edit two files. Lets begin with the <yourWebPart>.ascx.cs file. What you will do there is setting up the propertiesobjects. Later you can use them to read the values the user typed in. I make a difference between two kind of properties: 'easy' and 'not that easy properties'. I do not call it 'not that easy', because it is hard to use, I call it that way because you need a line of code more. An easy propertiy would be a textfield. The code you need to add would look like this. 1 2 3 4 5 6 7 [WebBrowsable(true), WebDisplayName( "<youtDisplayname>" ), WebDescription( "<yourDescription>" ), Personalizable(PersonalizationScope.Shared), Category( "<yourCategoryname>" )] public string customTextProperty { get ; set ; }