A forgotten post : Registring a Custom Module with Sitefinity

Posted on June 14, 2007. Filed under: Building a pluggable module |

Custom module 101Over 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.

Advertisements

Make a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

4 Responses to “A forgotten post : Registring a Custom Module with Sitefinity”

RSS Feed for Sitefinity blog Comments RSS Feed

This is my problem:

XML Parsing Error: mismatched tag. Expected: .
Location: http://localhost/telerik/Sitefinity2.5/Default.aspx
Line Number 56, Column 6:
————————–^

HELP PLEASE

The Conclusion: Do not copy-paste from a blog post in which the wrong quotes have been used.
anesta, replace all the quotes from Ivan’s post with the “regular” quotes.
i.e. – ”

Ivan, great posts!
Keep’em coming!

Hello

I put Sample.Contact folders into my project and added the bits to my config, but I got the following error:

Could not find any resources appropriate for the specified culture or the neutral culture. Make sure “Telerik.Resources.Messages.resources” was correctly embedded or linked into assembly “Telerik.Framework” at compile time, or that all the satellite assemblies required are loadable and fully signed.

Sample.Contacts\WebControls\Admin\ContactEditor.cs
To avoid error I’ve commented lines from 135 to 140

Now I don’t see any controls when I press “Add new contact”

I think it’s because not implemented “DefaultContactEditorTemplate.InstantiateIn” in line 271.

How to solve this problem?


Where's The Comment Form?

Liked it here?
Why not try sites on the blogroll...

%d bloggers like this: