1

Article Page Template contains system/include/header
system/include/footer

It says that header region is included as Region on the Page, with works.
header.html uses "Include page (Header)" Page template & "Include page (header)" Page Schema.

That Page schema contains only 1 region, Header:

enter image description here

and Region Schema "[Header] Region" contains Component based on Schema "Menu".

Component is filled in region "Header" on the header.html Page. note: Core example has here 3 calls to the nested regions.

enter image description here

Question

Why need to call here @Html.DxaRegion("Header") again to get it work?
Region view header first time contains model see figure (Regions count 1, Entities count 0) When execute @Html.DxaRegions() same view is called. Second time @Html.DxaEntities works (it is levelt up).
enter image description here

3

Short answer: because your Include Page itself is "transformed" into a Region (along with its nested Regions and their CPs). There is no way around this.

7
  • I don’t think that placing CPs directly on the Include Page changes the situation; those CPs are implicitly put in a “Main” Region, so you will still have nested Region Models: the top one represents the Include Page and it contains a nested “Main” Region Model containing the Entity Models. – Rick Pannekoek Jan 15 at 8:59
  • No change indeed. Maybe there is way to call @Html.DxaEntities() in the first call (Header.cshtml), using the first region. – Frits Lesterhuis Jan 15 at 9:51
  • Is there a real problem with this extra level? The general idea is that an Include Page can contain multiple Regions, which translate to nested Region Models. – Rick Pannekoek Jan 15 at 9:59
  • Thanxs. If there is no shortcut it's fine. Maybe some ms cost when not in cache. – Frits Lesterhuis Jan 15 at 10:24
  • it applies to header/footer/tools(breadcrumb) for us. – Frits Lesterhuis Jan 15 at 11:21

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.