Can you create a set of modules that collaborate to achieve a cartain effect?
For instance, if I wanted to create an eCommerce extension of Cuyahoga, could I create a Catalog module, a Checkout module, a Categories module and a Cart module, sprinkle them around the nodes of the site and have them be smart enough to link to one another?
Say the cart module is in every node, we have a node called 'FoodItems' and a node called 'SportingGoods'. The food node(page) has an instance of the catalog with it's category set to 'Food' and an instance of the Categories module that will show a link to the parent category (that will contain a link to sporting goods) as well as all of the sub categories.
When the user selects pepperoni, it is added to the cart. When they are in food and they select 'Parent' they go to a page that shows all of the main categories.
Can the linking work? Can the modules deposit data into the cart? etc...
I'm afraid that at this moment there are no facilities for modules to communicate with each other.
It would be quite complex to let modules communicate with each other like you described with your eCommerce sample.
The closest you can get is with a solution that is similar to the one this forum uses. It is a single module but will load different user controls based on the querystring or pathinfo parameters (commands).
In the case of an eCommerce shop you'll have a single User Control (the module) that loads other user controls based on parameters. Some possible examples:
http://www.shop.com/cuyahoga/45/view.aspx/category/FoodItems:
This loads the eCommerce module and the module itself will analyze the pathinfo, load the category User Control and passes the FoodItems parameter to the category User Control. The category control will display all products in the FoodItems category.
or
http://www.shop.com/cuyahoga/45/view.aspx/cart:
The eCommerce module loads the shoppingcart User Control which will display the shopping cart of the current user.
The only thing that can't be done this way is integrating separate module pieces in the main navigation.
I hope this answer didn't disappoint you.
Good to know.
I thought I read somewhere that you were hoping that the yet another forum folks would publish a forum module for cuyahoga. That would be a great example. Is there any news on the forum front?
Jeremy
Well, I think we haven't gained enough momentum yet to even draw the attention of the YAF crew and to be honest, I've been too lazy to even contact them about this ;).
So no news unfortunately...
Can you distribute your version of YAF?
Not as a zipped distribution but I keep the modified YAF version in SVN at
http://tijnthuus.demon.nl/svn/repos/yaf/trunk/ and the Cuyahoga YAF module in
http://tijnthuus.demon.nl/svn/repos/cuyahoga/trunk/Yaf/.
You can check these out with a Subversion client.
Thst's great.
Thanks Martijn.
Dear All
The ECommerce module will probably use an EventMediator class - this is a (sort of) singleton that has one instance per request. Modules can notify the mediator of events, and also listen for event notifications. In this way, one module adding an item to the basket will also (indirectly) tell the basket display module that an item has been added. I'm not sure whether this already exists as core functionality in Cuyahoga, though.
I've been very impressed with the inclusion of CurrentViewControlPath() into ModuleBase. I'm not sure how long it has been there. When working with other CMSs I've been forced to load a container control which dynamically loads views based upon context.
Many thanks
Simon
All,
As i was reading this it occurred to me that could the Module Connectors not be used to achieve the required loose coupling??
The search and Search Input Module being an example.
cheers ged
Ged
Is this the InboundAction/OutboundAction stuff? Do you effectively subscribe to a named event?
Cheers
Simon