The content you're reading is getting on in years
This post is on the older side and its content may be out of date.
Be sure to visit our blogs homepage for our latest news, updates and information.
Over the last week or so I’ve received several comments asking how to register a custom module in Sitefinity. Obviously, this post should have been written way before in the Building a pluggable module section, but I have somehow missed it. I apologize and would like to thank the kind readers that pointed that out.
So here it goes… registring the module with Sitefinty. In case you have not already downloaded the latest download of Contacts Module project, you can do it here . The zip file contains two projects : Sample.Contacts and Sample.Contacts.Data.
You need to add both of those projects to your existing project in Visual Studio in effect creating a solution. If you already have a solution, just add those two projects. Then add both projects as a reference to the WebSite project (Sitefinity website).
Now that you have that project, let’s see what we need to do to register it.
1. You should add the config section for contacts module to your web.config. So find in your web.config <configSections> element, and then inside if <sectionGroup name=”telerik”> element. Paste the underline line inside that element.
<configSections> |
<sectionGroup name =“telerik> |
<section name =“contacts“ type =“Sample.Contacts.Configuration.SectionHandler, Sample.Contacts“ requirePermission =“false“/> |
</sectionGroup> |
</configSections> |
Sample.Contacts is the name of the project. SectionHandler is the class inheriting the base class ConfigurationSection and contains the functionality for loading and accessing the contacts section information.
2. Add the contacts section inside of telerik section group.Your contacts section will allow you to set various settings required by Contacts module. So find the <telerik> element and past the underlined text somewhere inside it (be careful <telerik> element must be a immediate parent of <contacts> section here).
<telerik> |
<contacts defaultProvider =“Sitefinity“> |
<providers> |
<clear/> |
<add name =“Sitefinity“ securityProviderName =“” |
type =“Sample.Contacts.Data.DefaultProvider, Sample.Contacts.Data“ |
connectionStringName =“DefaultConnection“ visible =“true“ /> |
</providers> |
</contacts> |
</telerik> |
As you can see the first and most rudimentary setting we need to set is the provider for this module. Sample.Contacts.Data is the data project for the Contacts module and DefaultProvider is the class providing an implementation for the provider model.
3. Finally, you have to register the module. The previous two steps were needed by the module, this last step actually registers the module with Sitefinity. Find the <framework> element and then <modules> element inside of it. Paste the underlined line inside of <module> element.
<framework> |
<modules> |
<add type =“Sample.Contacts.ContactsModule, Sample.Contacts“/> |
</modules> |
</framework> |
ContactsModule is the class, providing substantial information for your custom module. In my previous posts I’ve referred to this class as the main module class also. That’s the one inheriting WebModule class.
That’s all. Let me know if you need any other assistance.
View all posts from The Progress Team on the Progress blog. Connect with us about all things application development and deployment, data integration and digital business.
Let our experts teach you how to use Sitefinity's best-in-class features to deliver compelling digital experiences.
Learn MoreSubscribe to get all the news, info and tutorials you need to build better business apps and sites
Progress collects the Personal Information set out in our Privacy Policy and the Supplemental Privacy notice for residents of California and other US States and uses it for the purposes stated in that policy.
You can also ask us not to share your Personal Information to third parties here: Do Not Sell or Share My Info
We see that you have already chosen to receive marketing materials from us. If you wish to change this at any time you may do so by clicking here.
Thank you for your continued interest in Progress. Based on either your previous activity on our websites or our ongoing relationship, we will keep you updated on our products, solutions, services, company news and events. If you decide that you want to be removed from our mailing lists at any time, you can change your contact preferences by clicking here.