4

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.

1 Answer 1

3

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.

2
  • Any way to handle it in code? I don't want to touch content
    – beardeddev
    Commented Sep 26, 2016 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. Commented Sep 26, 2016 at 11:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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