[This post is part of the developer's manual preview published on this blog. You can find temporary TOC here.]
In this topic we are providing a sample intra site module. Intra site modules basically provide the same functionality as pluggable modules in Sitefinity, however, the approach is rather different. Namely, while pluggable modules are built from custom (composite) controls and deployed as an assembly (.dll file), intra site modules are primarily built from User Controls and several classes that are placed inside of the App_Code folder.
Intra site modules are generally easier and faster way to develop a module and require less experience, in particular with control development and control lifecycle. On the other hand, pluggable modules do take some more time and experience, but their advantage is the simplicity of deployment across multiple installations of Sitefinity. As a rule of thumb, if module is providing very specific functionality that will be used only inside of one Sitefinity installation one should develop an intra site module. If, on the other hand, module is generic and will be implemented across multiple installation or will be distributed as a third party component, one should build a pluggable module.
You can investigate both approaches by comparing intra site implementation of contacts module with the pluggable module implementation of contacts module.
Quick installation guide
- Download the project from here
- Create a new Sitefinity website or open an existing one (make sure that the name of connection string for your Sitefinity database is “Sitefinity”. “Sitefinity” is a default connection string name, so unless you have not changed it, you don’t need to do anything)
- Execute the db_create.sql file against your database to create the two needed tables for the contacts module
- Copy and paste App_Code, Modules and Sitefinity folders from the project you have downloaded to the root folder of your website
- Register the public controls for contacts module by adding following lines in the web.config as children of the toolboxControls element (after the <clear /> declaration!)
|<add name="Contacts List" section="Contacts" url="~/Modules/Contacts/Views/Frontend/ContactsListView.ascx" /> |
|<add name="Single Contact" section="Contacts" url="~/Modules/Contacts/Views/Frontend/SingleContactView.ascx" /> |
- Run Sitefinity and try out the contacts module.
*** BEGIN NOTE ***
Contacts intra site module has the same functionality as the pluggable module, except that it does not support multiple providers. While, intra site module can support multiple providers, modules that require such functionality would most probably built as pluggable modules.
*** END NOTE ***