Question

I want to do a tweak on the Search module, but I obviously don't want to mess with the original source, so is there a way to 'extend' an existing module? If so how? Or must I create a new module, copy the code from the Search module, and tweak that?

Was it helpful?

Solution

In any case you need to create your own module. Whether to copy the code and tweak it or create your own implementation of some existing interface from scratch is up to you - this relies on your specific scenario and the extent of the tweaking needed.

There are a few ways to extend existing things in Orchard:

  • Any service interface that implements IDependency can be overridden by simply putting your own implementation in your module
  • OrchardSuppressDependency attribute can be used on your class to explicitly disable certain existing implementations
  • Shape templates and normal views can be overridden in the theme as descibed in docs
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top