+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Custom module with child module

Custom module with child module

8 posts, 0 answered
  1. ian
    ian avatar
    45 posts
    Registered:
    25 Feb 2013
    02 Oct 2013
    Link to this post
    I am trying to create a custom module that has a child module. On the display side i want to do a list of the modules type with each of their children under them on the same page. I dont want users to have to click each parent to see all the children.

    Say you have a list of events. The parent would be the months and the children would be the events happening in that month. Im not sure if this is even possible.
  2. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    02 Oct 2013 in reply to ian
    Link to this post
    Hi Ian,

    That is not the way the default widgets of the Dynamic Modules are working.
    If you want to achieve such functionality, you would have to create your own widget and load data and the related data through the API.

    Let me know if you need help with that?

    Kind regards,
    Daniel
  3. ian
    ian avatar
    45 posts
    Registered:
    25 Feb 2013
    02 Oct 2013
    Link to this post
    so i cant get it to display parent and child all in one? I mean the Nav tool does it.
  4. Markus
    Markus avatar
    2763 posts
    Registered:
    25 Nov 2005
    02 Oct 2013 in reply to ian
    Link to this post
    Dear Ian

    If there are not to many module types you could drag multiple widget to the page and filter them. Sorry some hacky way to do it.

    www.marktold.com/screencast/sf_child_module.swf

    I use this in a scenario where I have a discription of a course (master) and the course dates (child) in a module.

    Now on the page I drag my course widget and filter it and apply the desired templates.

    Maybe if you have only a view top level and they don't have to be dynamic this could be a dirty workaround out of the box.

    In your scenario you would have to drag 12 events widgets to the page and filter them by title (month for example) Of course this would be the same in a year. If you want Oct 13 - Oct 14 (next 12 month) then you will go a whole different route  and take Daniels advice.

    Markus
  5. ian
    ian avatar
    45 posts
    Registered:
    25 Feb 2013
    02 Oct 2013
    Link to this post
    Markus

    I only need the one view. another scenario that im looking to use this is with a custom module that displays links to pdfs. the parent module will categorize them by type...tops...bottoms...accessories...etc. the child module will be the image of the template...the link to the template and the name. i just need one long list of everything but with the child under the parent. can i not bring the child data into the parent template?
  6. Markus
    Markus avatar
    2763 posts
    Registered:
    25 Nov 2005
    02 Oct 2013 in reply to ian
    Link to this post
    Dear ian

    Can't you just use the list module?

    Markus
  7. ian
    ian avatar
    45 posts
    Registered:
    25 Feb 2013
    02 Oct 2013
    Link to this post
    the list module didnt really work 100% like i wanted to i may just program it. just trying not to. also with the events module im going to call races...one day we want it to list all of the races by month and when you search an area then the list disappears and a map showing the races in the area shows.
  8. Ivan D. Dimitrov
    Ivan D. Dimitrov avatar
    310 posts
    Registered:
    26 Mar 2015
    07 Oct 2013
    Link to this post
    Hello guys,

    This functionality can be achieved with a few lines of code. Here is what I used to filter them by month:

    private List<Telerik.Sitefinity.Events.Model.Event> GetEvents()
            {
                DateTime date1 = new DateTime(2013, 10, 21);
               
                EventsManager librariesManager = EventsManager.GetManager();
     
                return librariesManager.GetEvents().Where(i => i.EventStart > date1 && i.Status == ContentLifecycleStatus.Live).ToList();
            }

    Additionally, you can add tags to events in order to filter them from the events widget. For example adding a October tag to events that will take place in October allows you to show only those in the front end. Regards,
    Ivan D. Dimitrov
    Telerik
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
8 posts, 0 answered