How can I override the view selection for Main region in DXA so that I can use view from my module instead of the core view?

RegisterViewModel("Main", typeof(RegionModel));

doesn't work for me, it still calling the view from the core area.


You need to change the Region metadata on your Component Templates to use your module region view. By default they are empty, which means they access the Core module Main region. After updating you will need to republish the pages which use these templates.

  • Any way to handle it in code? I don't want to touch content – beardeddev Sep 26 '16 at 11:22
  • 5
    @beardeddev Templates are not content, but implementation I would say. However you can only change which regions are used in the CM on the CT metadata as Will mentions indeed. Overriding the view of the main core region is not something which can be done in a module, you have to adjust the CoreAreaRegistration.cs and supply a different view for the main region there. – Bart Koopman Sep 26 '16 at 11:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.