Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Tutorial to create own modules

Vote:
 
Hello,
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
#186465
Dec 20, 2017 11:31
Vote:
 

What are your goals with this?

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

#186468
Dec 20, 2017 12:27
Vote:
 

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.

#186471
Dec 20, 2017 12:47
Vote:
 

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.

#186474
Edited, Dec 20, 2017 13:00
Vote:
 

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

#186477
Dec 20, 2017 13:40
Vote:
 

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.

#186481
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.