November Happy Hour will be moved to Thursday December 5th.

Modified default (page) controller

Vote:
 

Hi,

I've seen some default page controllers which look more or less like the example in http://blog.huilaaja.net/2014/02/07/episerver-default-controller-to-avoid-dummy-controllers/

Check out this gist for a modified version https://gist.github.com/rbaarda/b2a753f09053411859bb
This modified default controller respects the view locations set in the view engine and uses the page type as controller name. So you don't need to hardcode that view path in the controller anymore.
Next to that, you could implement your own view engine and add extra view locations which will be searched as well when using the default controller.
I've also made a similar defaultcontroller for blocks including a preview controller.

I thought maybe it could be of use to someone, let me hear what you think.

Regards,

Robert.

#120810
Apr 24, 2015 15:13
* 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.