"Overriding" Part Driver

Topics: Writing modules
May 18, 2011 at 11:19 AM

Is there a way to override a Part Driver?

Scenario:
I need some more Data for my module ContainerPicker, where you can pick containers in a more comfortable way.
I created a new template for the Containable Part but the ViewModel i get has no information about the ContentType the current ContentItem has.
I need this information to hide the containers who only contain other content types.

Possible Solution:
Create own Implementation of the containable part with slightly different driver.
But thats not very comfortable and also ugly.

Greetz

 

May 18, 2011 at 12:25 PM
Edited May 18, 2011 at 12:26 PM

This is one limitation with lists. The problem is that the controller doesn't pass in the container item so you'd have to replace the whole controller to do anything about it! I think the team might be addressing this for the next version. But this is another reason why I'm working on the Mechanics module, so you have a much more configurable and flexible system of relationships.

May 18, 2011 at 12:29 PM
randompete wrote:

This is one limitation with lists. The problem is that the controller doesn't pass in the container item so you'd have to replace the whole controller to do anything about it! I think the team might be addressing this for the next version. But this is another reason why I'm working on the Mechanics module, so you have a much more configurable and flexible system of relationships.


I think the container and taxonomy module do complement each other quite well.

May 18, 2011 at 12:59 PM

Yeah. The idea of Mechanics though is to allow you to custom-build whatever types of relationships you like. So you could build a Container analog as well as a Taxonomy analog just by defining certain types of connector. It's also a lot easier to hook in custom UI (e.g. your ContainerPicker) - this is the next big update I'm doing, followed by routing scenarios to give you the same nested routes as container and taxonomies (but again with extended scenarios such as filtering lists on sub-routes).

May 18, 2011 at 1:01 PM
randompete wrote:

Yeah. The idea of Mechanics though is to allow you to custom-build whatever types of relationships you like. So you could build a Container analog as well as a Taxonomy analog just by defining certain types of connector. It's also a lot easier to hook in custom UI (e.g. your ContainerPicker) - this is the next big update I'm doing, followed by routing scenarios to give you the same nested routes as container and taxonomies (but again with extended scenarios such as filtering lists on sub-routes).


Is your Mechanic module the same as the Connector Module you've spoken earlier?

 

May 18, 2011 at 1:50 PM

Yep. There's a version on the gallery right now, but quite a lot is about to change. I've been working on an update for the last week or so and it adds much better UI composition for editing and displaying connections, and a generally improved system of placement and template overrides. It's kind of done, I'm just testing a few things, then it needs a writeup and maybe a screencast or two to make it more obvious how it all works.