3

On a DXA 1.6 .NET based website I want to remove the core module and use my own module for all models and views. How can I tell DXA to use my custom "Main" region view instead of the OOTB Core:Region:Main view?

Update: I managed to create a custom module in the Content Manager; and in the webapp our custom models, and entity, region, page and include views. The last piece of the puzzle is the Main region. I think the Main region does not have a component template, page template or template meta data associated so I wonder how to write the Main region to my custom region view.

  • 1
    "I think the Main region does not have a CT associated" -- it's the other way around; you always have a CT, but if the CT doesn't specify a Region (View) name (either in metadata or in its title), then the Entity is put in a Region called "Main" (using the Core:Main View). If you don't want that to happen, just ensure you specify a Region View name on your CTs. – Rick Pannekoek Dec 1 '16 at 20:00
  • Thanks Rick, it is indeed the other way around. DXA chooses the defaults if you do not specify a region view in the CT. – Jan H Dec 8 '16 at 13:52
3

If you are using only your own models and views, then presumably you are also creating your own schemas, PTs and CTs.

I guess you have two approaches:

  1. Delete all the existing Core Area views, and replace them with your own. DXA uses core as the default area if it doesn't get one specified in the CT/PT metadata
  2. Create a new Area for your views, and configure your CT and PT metadata to ensure that they point to the new area. For the CTs in the main area just set MyModule:Main in the Region View Name property on the CT.
  • Thanks for your reply Will. I did just that: all my CTs and Pats are wired to my custom module/area. The missing piece is the Main region view. I have added some info to the question to clarify. – Jan H Dec 1 '16 at 16:46
  • You can specify the region (with area/module prefix in the CT metadata) – Will Price Dec 1 '16 at 18:45
  • Approach 2 is the clean way to do this and it works for me. What I overlooked when asking this question is that you can simply set MyModule:Main for the Region View Name property on the component template. – Jan H Dec 8 '16 at 13:52

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.