Can a module have its own areas?

Topics: Writing modules
Oct 22, 2012 at 6:16 AM

I'm new to developing with Orchard and i wanted to create my next project as an Orchard module so I can do all the awesome things you know Orchard is capable of.

The site I want to build will probably need a few Areas or its own and i was wondering if this was possible since Modules are already an area in Orchard.

What i want is
i.e. Orchard/MyModule/MyModuleArea

I know i could achieve all this by using custom Routes but I like the organisation that Areas provide

Thanks

Coordinator
Oct 22, 2012 at 6:25 AM

Modules have features. Subfolder organization is going to be challenging however as there are conventions that would prevent such strict segregation. In any case, I really think you are overthinking it. If it deserves strict separation, maybe you should create separate modules. Otherwise, just make features, use sensible routes, and write clean code.

Developer
Oct 22, 2012 at 9:51 AM

No, the areas convention is not currently supported.

I believe there was an issue raised around the 1.0 mark, but got pushed to future versions.

I would tend to agree with Bernard that you are probably over thinking your approach, go with name spaced modules.

Nick M

Coordinator
Oct 22, 2012 at 5:54 PM

For what it's worth, I don't think you can nest areas in MVC in the first place and that would be
unnecessary complexity.
Clearly, features and good namespacing gets you almost there, and if someone submitted that feature, I'd
kill it.

You won't find many cases where the module is big enough that areas would be preferable
over those elementary mechanisms, that are very simple and seem to be
underappreciated nowadays.

Naturally, a good set of routes also
is a good way to present a neat and tidy separation to your
customers. Now if you think the line breaks in this post are a little weird, well, I don't
know, maybe you're right. 

 

Oct 23, 2012 at 7:46 AM

I guess i was also thinking along the lines of also converting a few of our existing MVC apps (that use areas) to modules and plugging them straight in but that clearly isn't going to happen

Thanks guys

Coordinator
Oct 23, 2012 at 8:28 AM

Shouldn't each of those areas be modules then?

Developer
Oct 25, 2012 at 10:45 PM

The line breaks are all weird.

Oct 26, 2012 at 12:03 AM

A Module per area sound like the way to go... I was just hoping to "plug it in"

Thanks guys