We assume you are using Visual Studio 2010 for these directions. If you are using something else, please change to the appropriate folder.

Install the Titanium Module template. If you have done so, skip to step 1.

  1. Download Ti_Module.zip found in this wiki article.
  2. Move it to "My Documents\Visual Studio 2010\Templates\ProjectTemplates\Visual C#\"

Step 1: (Create new Module from the template)

  1. Open the Titanium solution.
  2. In the solution explorer, right click on the solution and click add, then new project.
  3. Select the Ti_Module project template and name it something that relates to the module you are making.
  4. Click OK - this will create a project with a basic outline of a Titanium module.

Step 2: (Modify the Project)

  1. Edit the Model with the properties that you want it to have.
    1. Ensure that you include the proper flags/attributes.
      1. [Required(ErrorMessage = "message")] - All required properties should have this. If this is left empty by the end user Titanium will throw a validation error.
      2. [JsonProperty] - Almost all properties should have this.
      3. [JsonIgnore] - Any property that you don't need to save, when the module is saved to the database.
      4. [JsonConverter(typeof(Newtonsoft.Json.Converters.IsoDateTimeConverter))] - If you are going to use a DateTime property and also plan on editing it in javascript it is a good idea to have this one.
  2. Edit Admin Edit.aspx (view) - this view is used to display the properties of the Model, and to allow the site admin to set the values.
  3. Edit the .ascx file (view) - this is the partial view that displays the module, it uses the properties that are set in edit.aspx. There can be multiple views per model.
  4. Edit manifest.config (manifest) - this manifest tells Titanium what views this DLL will have and how to use them. The auto-generated one does not have to be edited for the default view.
  5. Any images, css, xml, flash, or script files that this module will use, need to be included in the Assets folder under the correct folder. Once you have added the file to your project. Right click on it in the solution explorer and click properties. Then change the "Build Action" to be "Embedded Resource".