There is a standard structure to Sitecore Habitat Feature Projects, and after creating a few (and blogging about it here: http://www.nttdatasitecore.com/Blog/2016/February/Building-Something-In-Habitat), I got tired of copying and renaming files.
Because I'm a lazy programmer, I created a visual studio template to make my life, and my colleagues lives, easier.
The src folder contains the source project that I used to create the template. The Sitecore Habitat Feature Visual Studio Template.zip file contains the template that can be installed in visual studio.
##Feature Project Template Installation Instructions
- Download Sitecore Habitat Feature Visual Studio Project.zip from https://github.com/ekapus/SitecoreHabitatFeatureTemplate
- Copy the zip file to to C:\Users\Administrator\Documents\Visual Studio 2015\Templates\ProjectTemplates\Visual C#\ on your local machine.
- Run the following command from the Visual Studio Command Line (accessed from the start menu at Visual Studio 2015/Developer Command Prompt For Visual Studio 2015:
devenv /installvstemplates
Note: this can be done while Visual Studio is running.
For more info about finding, organizing and installing Visual Studio Project Templates: https://msdn.microsoft.com/en-us/library/y3kkate1.aspx
##Feature Project Template Use Instructions
- Create a new solution folder in your Habitat Solution under "Feature" that describes your feature.
- Right click on the new solution folder, choose add, and select "New Project".
- Scroll through the project types and select "Sitecore Habitat Feature".
- Enter a name for your feature. It's best to omit spaces and punctuation.
- Using windows explorer, create a folder that matches your solution folder name under "Your Habitat Project Root\src\Feature"
- Under the folder you just created, create a "code" and a "serialization" folder.
- Choose the code folder you just created as the location for the project you're creating.
- Hit OK
- Open your new project.
- Rename /Views/$safeprojectname$ to /Views/YourProjectName
- Rename /Models/$safeprojectname$ to /Models/YourProjectName