More in this section

Forums / Developing with Sitefinity / One-to-many Custom Module

One-to-many Custom Module

2 posts, 0 answered
  1. Thomas
    Thomas avatar
    8 posts
    Registered:
    16 May 2007
    31 Oct 2007
    Link to this post
    I'm wondering if anyone has created a custom module with a behavior following the same pattern as the following example:

    Say you wanted to create some type of real estate module that would display property litings.  The listings would use a different layout template depending on the type of housing property.  The client web user would go to the listing page and be able to see the different housing properties listing on one page by selecting from a dropdown list.  On the Sitefinity CMS site, the editor user would go to the housing property custom module admin view and would need to be able to select one of several layout templates for a property listing, add pictures and text, and then save this page onto the "stack" of existing properties listings.  In addition, an entry would have to be made to the dropdown list to add this new page.  In other words, you would be able to manage each listing through the same custom module admin view.  I could do the same through a ascx user control, but this seems an ugly solution as I would need to create a page on the site just to house this admin page. 

    Has anyone had experience with any similar type of one-to-many module?  Any help or direction would be greatly appreciated. 
  2. Slavo
    Slavo avatar
    295 posts
    Registered:
    24 Sep 2012
    01 Nov 2007
    Link to this post
    Hello Thomas,
    You can achieve this in many different ways. Just to make sure we're on the same line, I'll tell you how I understand the scenario.
    You have several types of housing properties. You want a module that has several templates for displaying those types. In the administrative part of your module, you need to display a list of property types and change the template, according to the property type.
    One way to implement this is by dynamically creating a CMS page for every type of property. When you do that, you can tell the page to use a specific template (already created) depending on what property type was chosen. In this case you can control the page URL, whether it shows in navigation and other CMS specific page properties. Sitefinity exposes an API and you can utilize it for dynamically creating pages and interacting with the CMS core. There is no problem to do it as an intra-site module, which uses user controls for the administration part. You just have to follow the guidelines for creating Sitefinity modules and register your controls for the module. In this case you wouldn't need to create a separate page for administering your module.
    For details on how to implement intra-site modules with user controls, please have a look at the Jobs Intra Site module that comes with Sitefinity, and the Developer Manual. In fact, we will create a simple example with the functionality you want and make it publicly available, but this would take a few days. We would either post it in our Forums or on http://blogs.sitefinity.com, so make sure you check them out periodically.

    Regards,
    Slavo
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
2 posts, 0 answered