Creating Page-Based Modules in Sitefinity 4

Creating Page-Based Modules in Sitefinity 4

Posted on May 19, 2011 0 Comments

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.

One of the most powerful features of Sitefinity 4 is the ability to use the CMS platform itself to modify its own Administration Backend. This means you can use Sitefinity to edit Sitefinity, creating pages on the backend as easily as you do on the front end.

This presents a great extensibility point, because it allows you to create modules on the fly by simply creating a page in the backend and dropping a custom administration user control onto the page!

Video Demo

I prepared a video demonstration walking through this process from start to finish with a basic "Hello, World" module. Take a look then read on for more details.

video-thumbnail

Watch Video on Telerik.TV

Widgets

For a Page-Based Module, you'll need to implement at least two widgets: One for the Administration, and one for the Public view.

You can implement these any way you wish, or reuse existing controls you've already developed, connecting using any data source method you wish (object, dataset, sql, xml, etc). As long as the user control is self-contained, it should work as a widget.

The same goes for the public view. You an implement separate widgets for list/details view, as long as you handle communication between them at the control level, such as using query strings to share data back and forth.

Toolbox

In order to be able to drag these controls onto the page, you need to register them in the toolbox. For help with this topic, see the following documentation: Adding Controls to the Toolbox.

Note that you do need to add the admin widget to the toolbox as well in order to be able to drop it on the page. However you can immediately remove it from the toolbox after installing it on the page. In addition, you could also utilize Configuration Policies to only allow specific users to see the admin widgets.

Pages

Since a Page-Based Module has two components (admin/public) you'll of course need to add two pages, one in the front end for the public view, and one in the backend for the admin view.

The Backend Page Editor (Under Administration > System > Backend Page Editor) allows you to quickly add a new backend page to the Sitefinity Administration at any location, such as under the Content menu or even at the top level, as I did in the video demo.

Upgrading and Uninstalling

Because these modules are Page-Based, modifying the administration or public view is as simple as editing the underlying user controls. Make your changes, recompile and your module will be immediately updated.

Uninstalling your Page-Based Modules is also a breeze, since they are simply pages in the Sitemap. Simply use the Page Editor to delete the pages, and remove the items from the Toolbox.

Be sure to delete the controls from any public pages that use them if you are also going to delete the public user controls. You can also leave the public user controls in place so that they can continue to be used even after deleting the administration page.

What's Next

Page-Based Modules are a great way to easily extend Sitefinity with custom functionality. This is especially true if you've already implemented a solution and want to reuse it in Sitefinity.

Next time, we'll take this a step further, and wrap this process into an actual Sitefinity Module, complete with Install and Uninstall methods so that your modules are completely self-contained. The result is a module very similar to the "Intra-Site" Modules from 3.x, only much simpler!

Until then, try out Page-Based Modules on your own Sitefinity sites and share your experiences with us in the Sitefinity Discussion Forums.

progress-logo

The Progress Team

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.

Comments

Comments are disabled in preview mode.
Topics

Sitefinity Training and Certification Now Available.

Let our experts teach you how to use Sitefinity's best-in-class features to deliver compelling digital experiences.

Learn More
Latest Stories
in Your Inbox

Subscribe to get all the news, info and tutorials you need to build better business apps and sites

Loading animation