Thursday, 20 June 2013

Naming your feature

In SharePoint you use feature manifests to deploy the components that you've built. Now this might seem trivial, but you'd be amazed at the silly naming conventions I've come across.

So lets get started, first let's take a look at the solution explorer:


now make note of three things:

  • Project Name: FeatureDemo
  • Feature Name: FeatureName.WS
  • WS: the ws at the end of the name stands for WebScoped

Now let's open up our actual manifest and take a look inside

You'll notice three things

  • Title: This what you'll see when insepcting feature through site settings
  • Description: This will accompany the title
  • Scope: in this case we will be web scoped, there are four options, I'm only going to focus on site and web in this post.

If you navigate to site settings

Think of "Site" as your entire site, and think of a "Web" as a specific sub web of your site, so all of your webs make up your site.

so back to our example, if I where to deploy our project and look in the Web scoped features of our site I'd find

Notice that our Feature title and description from our Feature manifest are listed.

if you where to jump into your hive C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES\ and look for your feature you'd find.

Notice that the folder name is made up of your ProjectName_FeatureName.

this is why generally you like to preface your project name and feature title with some sort of consistent acronym,  this will group your custom features in both your hive, and feature lists.