More in this section

Forums / Developing with Sitefinity / Can modules span pages?

Can modules span pages?

2 posts, 0 answered
  1. Andrew Ryan
    Andrew Ryan avatar
    3 posts
    Registered:
    23 Apr 2009
    18 Dec 2009
    Link to this post
    I'm considering using SiteFinity as a portal for my CRM application. The question I have is whether modules can span across multiple pages. An example:

    My application has native concept of an event, registration fields, products, and payments. In my app, you can set up and event with prices, the registration form questions, and take electronic payments. Therefore, in the portal, I would probably want a module named EventViewer - but when someone clicks Register, I want them to be able to move through a five-step workflow that askes for event registration questions, payment information, and processes the payment, and then completes it.

    Now, a customer could have 500 events in my system, and I'm SaaS - keep that in mind. I don't want to be creating custom pages when someone adds an event to me system, particularly becuase I may not have access to their SiteFInity installation! I need a module that I can drop on a page that:

    * Shows the event information from my built in webservice
    * Allows a person to register
    * Takes them through the aforementioned workflow

    My question is - it seems like a module is on "a page." What if I want to modularize processes like these that take place on multiple pages?
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    19 Dec 2009
    Link to this post
    Hi Andrew Ryan,

    Thank you for your interest in our CMS.

    Well this is usually how the content view controls work by design. You have content items in different content modules (Events, News, Blogs, etc) then on your public pages you add content view controls. If you add events view control you will be able on this page to see all events, and have Sitefinity generate a page for viewing single items, or create a second page for viewing single items. This means that you need 2 pages to view all events. You can customize the Events View controls to work with multiple events data providers, based on some information pulled from query string for example. You can also filter and sort content items based on their meta data.

    If the built in controls do not satisfy your needs you can create your custom controls, tie them up to webservices which wrap in the Sitefinity API and pull content items from your DB. For the register process of your Events you can create custom controls which will inherit from the built in EventsView control. Then when you display single event items you can expose the item ID and then add in your custom logic for registering for an event. Here is sample code snippet how to expose the event id of an event being displayed in detail mode:
    using System;
    using System.Collections.Generic;
    using System.Collections.Specialized;
    using System.Linq;
    using System.Web;
    using Telerik.Framework.Web.Design;
    using Telerik.Events.WebControls;
    using System.Collections;
    using Telerik.Cms.Engine.ContentViewFiltering;
    using System.Web.UI.WebControls;
    using Telerik.Events;
      
    namespace Telerik.Samples.Events.WebControls
    {
        /// <summary>
        /// Summary description for CustomEventsView
        /// </summary>
        [ControlDesigner("Telerik.Events.WebControls.Design.EventsViewDesigner, Telerik.Events")]
        public class CustomEventsView : EventsView
        {
      
            public override string ItemListTemplatePath
            {
                get
                {
                    //Provide the path to your Events List template
                    return "~/Sitefinity/Admin/ControlTemplates/Events/Modes/ListPageMaster.ascx";
                }
                set
                {
                    base.ItemListTemplatePath = value;
                }
            }
      
            public override string SingleItemTemplatePath
            {
                get
                {
                    //Provide the path to your Single Event Item template
                    return "~/Sitefinity/Admin/ControlTemplates/Events/Modes/ListPageDetail.ascx";
                }
                set
                {
                    base.SingleItemTemplatePath = value;
                }
            }
            protected override void CreateSingleContent()
            {
                base.CreateSingleContent();
                Literal id = (Literal)base.SingleContainer.Controls[0].FindControl("ContentID");
      
                if(id!=null)
                    id.Text = this.SelectedItemId.ToString();
            }
        }
    }

    Now all you need to add is a literal with ID ContentID to the control template for displaying single event items.


    Kind regards,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
2 posts, 0 answered