Using Alternatives for Document.cshtml in Orchard CMS

后端 未结 3 1933
独厮守ぢ
独厮守ぢ 2021-01-14 07:02

I am currently working on a website that requires the ability to overwrite the document.cshtml file so that I can apply a specific CSS-class based on the user\'s current loc

3条回答
  •  情话喂你
    2021-01-14 07:36

    Document.cshtml is a wrapper for the Layout shape. Wrappers don't support alternates. The only way to replace the document.cshtml template selectively is to remove the existing wrapper from the wrappers collection on the metadata of the layout shape and add your own.

    But wait... I can't think of any good reason why you'd want to do that. What's in document.cshtml is boilerplate HTML that should be the same across the site. The solution described in your update is the way to go.

提交回复
热议问题