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.
- Download Ti_Module.zip found in this wiki article.
- Move it to "My Documents\Visual Studio 2010\Templates\ProjectTemplates\Visual C#\"
Step 1: (Create new Module from the template)
- Open the Titanium solution.
- In the solution explorer, right click on the solution and click add, then new project.
- Select the Ti_Module project template and name it something that relates to the module you are making.
- Click OK - this will create a project with a basic outline of a Titanium module.
Step 2: (Modify the Project)
- Edit the Model with the properties that you want it to have.
- Ensure that you include the proper flags/attributes.
- [Required(ErrorMessage = "message")] - All required properties should have this. If this is left empty by the end user Titanium will throw a validation error.
- [JsonProperty] - Almost all properties should have this.
- [JsonIgnore] - Any property that you don't need to save, when the module is saved to the database.
- [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.
- Ensure that you include the proper flags/attributes.
- 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.
- 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.
- 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.
- 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".