Custom Module

Mehrdad Babaki asked on February 27, 2015 00:46

I want to know more about Kentico module. I developed the module sample in Kentico documents and I know that module is for extending functionality of Kentico but it is not clear yet when I need to develop a module and how bring this functionality to my website. In the sample I see the module is more like a data entry application and only we have a grid table as an interface that admin have access to. But in real world I guess we usually don't write it for data entry and usually our module has an connection with anonymous users. I think if I found a more serious sample probably I can make it more clear. Thanks for any help

Recent Answers

Brenden Kehren answered on February 27, 2015 02:17 (last edited on March 9, 2015 20:48)

A module could be used for more back end configuration or setup or it could be used to display data on your site.

If you're looking for data in your site, I'd check out using a custom page type vs a module. One of the last projects I worked on I created a module to manage a schedule which was displayed on the site but also had other logic wrapped around open and closed times.

You really have to look at the requirements before deciding on a module vs a page type.

1 votesVote for this answer Mark as a Correct answer

Charles Matvchuk answered on February 27, 2015 02:56

I just finished developing a pretty neat module, as an example. We have a wiki format for a lot of the site. The problem is, is that I do not want anyone having access to the tree. So the module we built, handles creation of Pages (Page Types - Document Types) by selecting them from a drop down box, dynamically modifying the form and inserting them into the tree in the correct location.

Country > State > Hotel > Ramada Inn

This way I do not have to give access to the tree and since the layout is standard we have one form to work with. Also, I used DevExpress AspxGridView which is the most fully featured grid on the market. Put it in tabular mode with a listing page which lists all of the hotels. If they need to modify a field on a 1000 records, they wouldn't have to traverse the tree and it is done in an excel like format. Mass data updates is now easier. Kentico is great in most scenario's. Before I create a module I really sit down and think if it is the best way to go and if it is really needed.

1 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on February 27, 2015 14:18

Nice example Charles! Couldn't agree more on really determining if the module is needed or not. It's not that they are hard to develop or create within Kentico (as v8 makes it a lot easier and far less code), its the process really and what your end result will be.

1 votesVote for this answer Mark as a Correct answer

Brian McKeiver answered on February 28, 2015 20:59

I tried to create a pretty decent module example for integrating with a CRM system. Check it out here:

I agree with Brenden's answers, and would add that I think Modules are a perfect tool for when a higher degree of customization is needed, like integration with third party system or running lots of C# or Kentico API code. For more simpler customizations, custom web parts or custom widgets will do the trick most of the time.

Hope that helps.

1 votesVote for this answer Mark as a Correct answer

Mehrdad Babaki answered on March 1, 2015 05:07

Thanks all for very helpful comments. As an example, imagine we have a page that users must enter some data. there are some setting that only admin can change. Base on the module settings and users data, we have some graph as output on a website page that all users(anonymous users) can see. I think in this case, I should develop a module. I was wondering if there is a sample code or default template that I could use as base of my development. In the Kentico document sample, there is only some UI in admin part, and nothing for website public pages. Actually I have a background in DNN. In DNN we have a default module which has a very simple, View, edit, setting page as well as provider and info files. So a developer easily get how must a normal module be developed. I am looking for such a template or sample code to make sure my structure of the module is correct.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on March 2, 2015 14:36

You can easily create some "admin" settings within the Modules app and allow only Admin users to edit them. Then in your code you can access those settings with a single line of code. Depending on the data you are capturing from the user, it could simply extend the User Settings object or another page type. Again, no code needed for this as you can configure it within the UI and output your data via a transformation.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.