Hi
What is "Best Practice" when developing "complex” module?
Eg. I have started the development of a Cuyahoga Forum module - from scratch.
So far I have the creation of categories, and forums in place, but now it get's "tricky" :)
The module is displaying forum in different categories, but what is the best way to make the module communicate with itself ?
Should I create a new .aspx page for viewing a specific forum, and if, what should inherit from... BaseModulepage in order to keep the layout of the site ?
Basically I’m looking for a more "advanced" module sample :)
Thanks in advance.
Best
Steen
With the current Cuyahoga version it's best to create one single .ascx control that has a placeholder for other ascx controls. Now depending on pathinfo parameters or a querystring, the main .ascx control can load other .ascx controls into the placeholder.
The next Cuyahoga version will contain an improvement where it's not necessary anymore to have a 'parent' usercontrol to load the child controls. Loading the correct usercontrol is the responsibility of the module controller class (ArticleModule.cs, DownloadsModule.cs) to make it more like a real controller.
Hi
If I get you correct I have to:
public class CuyahogaForumModule : ModuleBase, IActionProvidor
{
public CuyahogaForumModule (Section section) : base(section)
{
SessionFactory sf = SessionFactory.GetInstance();
sf.RegisterPersistentClass(typeof(Cuyahoga.Modules.CuyahogaForum.Domain.Forum));
sf.RegisterPersistentClass(typeof(Cuyahoga.Modules.CuyahogaForum.Domain.ForumCategory));
sf.RegisterPersistentClass(typeof(Cuyahoga.Modules.CuyahogaForum.Domain.ForumPost));
base.SessionFactoryRebuilt = sf.Rebuild();
this._outboundActions = new ActionCollection();
this._outboundActions.Add(new Action("ForumView", new strimg[1] {"ForumId"}));
this._outboundActions.Add(new Action ("ForumPost", new strimg[1] {"ForumId"}));
}
}
and then the framework handles the loading of the correct usercontrol ?
This is not entirely what I meant. The actions you created are meant for inter-module communication where the actions are exposed to make easy module connections possible.
A single module doesn't need these.
I'm still struggling a bit to find the best solution though for actions within a single module. If you look in SVN, the new ProfileModule (in /Modules/User) uses the actions concept, but I'm not entirely happy with that yet. Expect some changes in this area.
ahhh.... now I think I got it... "simply" have a placeholder in the "main" user control, and then LoadControl...
I'll try :)
Do you know when the "next" version of Cuyahoga will be available ?
The next version wouldn't take too long, simply because I need features like sections in templates and module-connections in my current project at work. Expect it to be there in about two weeks.