In Sitecore helix how to reuse feature-project views in project-layer

628 Views Asked by At

I am new to helix pattern in sitecore. Please find below points

  1. I have Main website project in Project//CDB.Helix.Sitecore.Project.website like below solution structure

    enter image description here

  2. In website project i have PageLayout view that refrencing a placeholder for Feature //CDB.Helix.Sitecore.Feature.Header's controller rendering.

    enter image description here

  3. When i add reference CDB.Helix.Sitecore.Feature.Header in main project CDB.Helix.Sitecore.Project.website

  4. Views/BasicHeader is not identified by main project.

  5. How do i reuse the HeaderProject views in my main project, How to reference effectively?

1

There are 1 best solutions below

0
On

1) It is important to understand how the references should be in helix with the tree layers, so it should be one way with the following order : project-> feature -> Foundation: enter image description here

and as I see what you have done is right.

2) Then you should have placeholder lets call it "phBasicHeader" in your page layout, and this is a placholder key, where the header should be rendered:

@Html.Sitecore.Placeholder("phBasicHeader")

3) Now from Sitecore you should have rendering (controller or view) for your basicview.chtml :

enter image description here

4) Then from Sitecore, you add this view rendering to your item or template standard values, on the phBasicHeader like this:

enter image description here