New Module Organization Recommendations

Topics: Writing modules
Oct 12, 2011 at 12:58 AM
Edited Oct 12, 2011 at 9:36 PM

scratch this post...that wasn't a very coherent question.

I'm having a difficult time understanding how to use a Driver as opposed to a Controller. I've done everything on my other projects with Routes, Controllers, and Views...but I thought I'd delve into using Drivers and Shapes on this one since they seem so much more powerful.

So...I created my Part and I created a Driver for it that returns a ContentShape calling a shape that I created under Views/Parts. I created a Placement file and defined where the Parts would go. Here's where I'm having some disconnect....how do I get the shapes to display? I want to create a Route, Controller and View because I don't think it should be a Content Type that I have to attach to a Page or another Content Type, but if I do that, doesn't that override the Driver and therefore, no shapes?

My model is for a Unit in an Organization...I want to be able to display a list of Units, add/delete/modify an existing Unit through a regular page, not the Admin UI. Can I do this using Shapes, or are Shapes limited to just widgets and Content Types?

If there is some documentation that I missed regarding this, can you point me towards it? Thanks.

Oct 12, 2011 at 10:57 PM

okay...found part of the answer:

Creating a shape from a controller is extremely easy and there are many examples throughout the code. Most of the time you'll want to create a shape from a content item. For example, the blog post controller does this:

dynamic model = _services.ContentManager.BuildDisplay(postPart);
return new ShapeResult(this, model);

I'm assuming this uses the Display code from the Driver...just need to figure out how that should look now.