In the pevious post I discussed about the importance of branding in custom features within SharePoint projects, this post looks in to additional custom code and how the same principles apply to custom coding and features:
- Custom Web Parts
- Custom Lists and Libraries
- Custom Content Types and Site Columns
the example used in this post relates to web parts.
Custom Web Parts
Disappointingly, the number of times I have seen custom web parts that are either not named or not grouped correctly is too many to count. As with the custom features, web parts should all have a proper title and description.
Ensure you name the web part suitably when adding it to your visual studio project. For example; blubaseWebPart.
Next, to add a suitable title and description to the web part do the following:
- open the webpart file, for example blubaseWebPart.webpart
- ensure that within the <properties> tags there is a suitable Title and Description
- to change the values, only edit the text string between the tags
<property name="Description" type="string">My Visual WebPart</property>
Finally, to add the web part to a suitable group do the following:
- open the web part Elements.xml file from solution explorer
- alter the following property
<Property Name="Group" Value="Custom" />
- change the Value to a suitable name such as Value=”blubase Web Parts”
Now when your web parts are deployed they will be grouped, have meaningful titles and descriptions and therefore be more relevant to the client, enable them to be found more easily and empower support staff in the future.
The same principles should apply to other custom coding, be it custom lists or libraries, content types or columns or anything being deployed as a feature. Make it meaningful, descriptive and appropriate to the project. Think how you would react in a situation where you had to support or develop on a system where you weren’t the original developer if you could not make head nor tail of the custom features.
Good coding should be from start to finish, and what the user sees in the interface reflects on the brand of the project, you and the company you are working for.