Closed remesq closed 5 years ago
Great suggestions @remesq. ad. 1 I specified the layout to be used in the NotFound page and it renders fine. (Also made it simpler).
ad 2. I made something basic working, added to both themes. @remesq great to hear some feedback about this. ad 3. Providing an Error.cshtml in the Theme project (in Views/Shared) does not result in that view being displayed in case of an error. I'm not sure what I should configure and where... @jtkech any insights, again, really appreciated.
Just a couple of thoughts:
On the
/ModernBusiness.Theme/Views/Shared/NotFound.cshtml
page, consider adding@{ Layout = "_Layout.cshtml" }
This helps avoid having to maintain the template in two separate layout files in case you make changes to one. EDIT: I see now this won't work because of the Breadcrumbs, unless you check if the model is empty by making the following change in
/ModelBusiness.Pages.Shared/Pages/Shared/BreadcrumHeader.cshtml
It would work then, for example, when a Not Found is thrown (not sure about other errors). Otherwise, without this change you would get a
Cannot perform runtime binding on a null reference error
.Consider adding a
Content.cshtml
view to/ModernBusiness.Theme/Views
. Any pages created in the CMS won't by themed otherwise. I just used theContent.cshtml
file fromTheTheme
and modified it to my needs. You can then add the layout to theme it@{ Layout = "../Views/Shared/_Layout.cshtml" … }
Not sure how to trigger the
_error.cshtml
view in/ModernBusiness.Pages/Pages
because I wanted to check if it, too, was being properly themed. That's not really a suggestion, just my ramblings. :) I guess maybe importing the layout in that file would work?