This project is read-only.

Creating an admin portal controllers vs content parts

Topics: Writing modules
Jun 6, 2013 at 5:57 PM
So I am trying to create an administrator portal in Orchard, using web services to access the information.

Something like this (random image from the internet): Image

Way I see it, there are two different ways of doing this

1) Controllers and Views
2) Content Parts, Drivers and Handlers

At the moment I am using controllers and views.

For example if I wanted to manage companies I would create a "CompanyController" and Create, Edit, Index and Details views. I'd an an entry on on the menu for this controller using the IMenuProvider.

Content Types and stuff is the more "Orchard" way of doing things but I'm not exactly sure how to use them.

I can create a "CompanyPart" but the way to create them seems to via the Content -> Content Items section.

What I want is to be able to create a "Create Company" page via the CMS and then add a "Create Store" component onto that page. This lets me mess around with the layout of the site as much as I like without having the modify the module.
Jun 7, 2013 at 7:43 PM
You could create a Company content type using a CompanyPart, and still work with custom controllers and views to render Company content items.
If you define a content type and set its "Creatable" option to "false", users will not see that content type appear in the "New" section, nor will its content items show up in Content - Content Items. Instead, you render these items yourself using your own controllers.