Custom module with child module

Posted by Community Admin on 04-Aug-2018 05:40

Custom module with child module

All Replies

Posted by Community Admin on 02-Oct-2013 00:00

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.

Posted by Community Admin on 02-Oct-2013 00:00

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

Posted by Community Admin on 02-Oct-2013 00:00

so i cant get it to display parent and child all in one? I mean the Nav tool does it.

Posted by Community Admin on 02-Oct-2013 00:00

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

Posted by Community Admin on 02-Oct-2013 00:00

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?

Posted by Community Admin on 02-Oct-2013 00:00

Dear ian

Can't you just use the list module?

Markus

Posted by Community Admin on 02-Oct-2013 00:00

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.

Posted by Community Admin on 07-Oct-2013 00:00

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

This thread is closed