Non-Content Based Modules
I've seen a lot of documentation and videos for building content based modules. I have a different scenario.
I'm building a module that self installs. It isn't for managing any kind of content. For simplicity's sake, lets assume it allows users to manage a robots.txt file in the site. The module's only purpose is for allowing the user to change settings. For example, one of the settings might be to disallow a certain page group or to disallow all events. This module isn't managing content or any kind of repeated data. It is for managing settings or configuration.
Is there an easier way about doing this? Managing settings/configuration through a module (or at all)?
Hello Chris,
We generally assume that modules manage some kind of data. A module is essentially backend user interface to manage this data, and also public controls which you can use on pages to display the data.
In your case, although you don't need a real module, you can create just the backend user interface. You have the ability to create backend pages in Sitefinity. Just make a custom one, and place a control that implements all the functionality you need.
This will look like a module, but it won't be a real one.
Chris,
I'm currous, how did you setup your module to self install? Is there documentation or a blog post on how to do this kind of thing? Any help would be great. Thanks.
Craig
Hello Craig,
I'm not sure how Chris has setup things, but if you look at all module samples in the Sitefinity SDK, you'll see all of them are installed when you launch the sample. We are doing this through code. If you open a solution in Visual Studio, you can take a look at the Global.asax file, where we use the Configuration API to register the module in Sitefinity. Hope that helps.
Best wishes,I have gone through the Sitefinity SDK and seen how to automatically register a module from a global.asax file, but I was wondering if there was a way to self-register without modifying the global.asax or Sitefinity configuration. Basically, is it possible to self-register a module or widget by just dropping an assembly into the bin folder of your Sitefinity web site?
From the research that I have done so far, I did not think this was possible until I made a discovery about one of the items in the Sitefinity Marketplace.
http://www.sitefinity.com/marketplace/modules/seo-sitemap-generator.aspx
If you navigate to the URL above and look at the section titles "How to install" you will see the following directions.
1. Download.
2. Unpack.
3. Copy .dlls to /bin directory of your Sitefinity site.
4. Done. (Sitemap generator registers automatically)
How is this even possible with out modifying the Sitefinity configuration, such as adding a new module or widget?
Hi Craig,
There is a way to achieve what you want, and the mentioned marketplace component uses it, however, we do not recommend it.
There are two methods you implement in each module - Initialize() and Install(). The first one is called on each application start, the second one just once. Usually we recommend people to perform the setup work in Install().
If you use the Initialize() method (or alternatively subscribe to the Initialized event of the Bootstrapper, like in Global.asax), you can skip the registration step. There are a couple of things wrong with this:
This is great information. Thanks for the reply.