Tutorial to create own modules

The page that we created with EpiServer has become quite extensive and consists of several separate segments. To keep track, we try to divide the segments into individual modules. Our attempts to implement the modules using C # libraries were not very successful. We use EpiServer in the current version with MVC and the Razer engine.

Are there any good tutorials for implementing modules with the module infrastructure that already exists in EpiServer, if these modules should contain Razer views?

Many Thanks

Best regards
Christian Fluhrer
Dec 20, 2017 11:31

What are your goals with this?

Speed up development in current project, share code between internal projects or share externally?

Dec 20, 2017 12:27

First goal would be to get a clear code structure, the second goal would be the possibility to turn on and of modules and to share modules between internal projects.

Dec 20, 2017 12:47

One idea could be to create then different nuget packages for each module that you can add specific to sites. Blog with example on how to create a nuget package: https://world.episerver.com/blogs/Alexander-Haneng/Dates/2011/8/How-to-create-an-EPiServer-NuGet-package/

Regarding views in general I would suggest looking into MVC Areas if you want for example create a folder for the module that contains models, controllers and views.

Edited, Dec 20, 2017 13:00

I would agree with Daniel this time - it's important to understand goals you wanna achieve. and then find tools to make that path ;)

Dec 20, 2017 13:40

Ok if it's only internal I would skip doing Addon at least. Episerver Addons are useful if you want to share with others but too much work otherwise.

For code structure I would start by using the SOLID principles as far as possible to make the code itself modular and extensible. Find a balance between generic modular solution and keep it simple. If you don't like the default setup for MVC I would recommend checking out feature folders. There are some blogs about that and Episerver.

Next and last step is actually sharing the code. Copy paste is usually what it boils down to unfortunately. I've done a few nuget packages too to use internally. Did it save me time? Nope :) Was it cool? Yes.

Dec 20, 2017 14:04
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.