Archive for March, 2007

Building a Module for sitefinity (part 2) : The concept

Posted on March 7, 2007. Filed under: Building a pluggable module, Projects |

Module is integrated in Sitefinity modules section as an assembly. This means that in order to create your own module you need to create a new C# project (Class library). The core class in this module you will name any way that you find suitable (for example : ListModule, MyModule…), but the important thing here is that this class needs to inherit Telerik.WebModule class.

In order to appear on the modules page and be usable, module needs to be registered in the web.config file.

The resulting .dll file you will obviously put in the bin folder of your website.

The module itself has two fundamental sides : administrative and public. The administrative side is the one you see in the modules part of Sitefinity, while the public side consists of the controls that users can drag onto the page in order to take advantage of your module. Take a look at the image below to get a better understanding of this distinction.Administrative and Public side of a module

In this post, I will concentrate mostly on the Administrative side of the module. The public part will be dealt with in one of the coming posts. The administrative side of the module furthermore can be divided into two more sections. The Command Panel and Control Panel. To understand this separation better, you can think of the command panel as the “left side” and control panel as the “right side” of the screen. In essence, Command Panel (left side) is there really just to facilitate the Control panel (right panel) with some kind of sub navigation. Take a look at this image to get a clearer picture.

Administrative side of the module

So the idea here is that you use the core class of a module (the one that inherits from a WebModule class) as some kind of container to hold the two other controls you will create : the CommandPanel and ControlPanel controls. What will those two classes do is completely up to you and depends on what your module is supposed to do.

Here you can download a template project to get you up to speed. [Need to create this project and post a link for download]

In the next post we’ll dig deeper into the code and create the two basic controls, namely CommandPanel and ControlPanel controls.

Advertisements
Read Full Post | Make a Comment ( 6 so far )

How to get reference to Control Panel from Command Panel (Building Modules)

Posted on March 6, 2007. Filed under: Gotchas |

The main purpose of the Command Panel (left part of the screen) in the module is to modify Control panel (right part of the screen) in some way – set property, call a method etc. In order to get the reference to the Control Panel you can use following code in the Command Panel :

ControlPanel ctrlPnl = (ControlPanel)this.NamingContainer.FindControl(this.ControlPanelID);

To some of you this may seem rather obvious, but I had to ask to figure this out. So to all you, mere mortals like me, here is how you do it 🙂

Read Full Post | Make a Comment ( None so far )

Building a Module for sitefinity (part 1)

Posted on March 2, 2007. Filed under: Building a pluggable module, Projects |

What is a Sitefinity Module?

Modules are quite probably the most powerful feature of Sitefinity. They allow you to extend Sitefinity in any way you need it to be extended. Need a image gallery on your site? How about blog aggregation tool? Or maybe product catalog? All this you can do by taking advantage of Sitefinity. Now, to see why is this so cool, think for a moment : You already have everything done except that particular functionality (e.g. blog aggregation tool). You don’t have to worry about the site navigation (already done), you don’t need to create an admin area (already done), you don’t need to worry about approval system (already done) etc.

Asp.NET practices

So, at this point you may think, that’s all nice and dandy… but it’ll take forever to learn how integrate my functionality into Sitefinity. Not so. I’m the best proof of that, since I’ve joined Sitefinity team just few weeks ago and I’m already building a module, heck… I’m blogging on how to do it. Namely, the architecture of modules is following all the best practices of for Asp.NET so most of the things will come natural to you. In addition to that, well tought architecture will simply (and unknowlingly) force you in building easy-to-maintain-and-extend modules. Take my word on this…

Now, to avoid risk of sounding like yet another marketer trying to sell you an idea, I’ll admit that you do need to understand some fundamental ideas of Sitefinity Modules. I had few problems on my own, and therefore I’m writing this series in hope to help you avoid these problems in the beginning.

Conclusion

This series will probably be extensive since I’ll try to cover as much of the process along the way, however at the end I’ll distill it into a “quick start” type of article. In the next blog post I’ll describe the basic concepts and ideas that you need to understand about any module. Then I’ll start to build a sampe module and provide you with some source code. So stay tuned…

Read Full Post | Make a Comment ( 2 so far )

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