OrchardCore: Admin shouldn't render Header inside
As pointed out by @bleroy on gitter TheAdmin Layout has a header section / zone which is rendered inside the `<head> section, and would produce invalid html if rendered too.
@await RenderSectionAsync("Header", required: false)
</head>
The SafeMode theme has the same issue.
We just need to figure out where a Header zone should be rendered in TheAdmin
i.e. before main content, or before side navigation (probably just before main content), or if we should remove the zone entirely.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 15 (15 by maintainers)
In some of my themes, I call this zone
MetaorHeadMeta.Ok, so confusion sorted.
Let’s get a bit of uniformity and consistency, and see if we can please everyone.
I hope we can agree that the
Headerzone has both historically, with O1, and in the current OC front end themes refers to a zone that should be rendered early in the<body>I don’t think it’s great practise to have a zone in the
<head>section where invalid html can be rendered, however it seems we have this zone already inTheAgencyTheme.Best practise is definitely the use of the Resource Tag Helpers. That’s why we have them.
We should add this Niraj if it is missing and useful.
Equally I don’t want to break what users are currently doing… and if used with care not to produce invalid html…
So will do a small pr, and move the
Headerzone where it should be inTheAdmin(it does have to be beforeMessages, or with the navbar css nothing will render) and add aHeadMetazone.@deanmarcussen we use both,
<resource type="Header"/>using style/script tag helper and<zone name=“Header”>to add adhoc styles/scripts/meta/base within shape templates with intention to render in<head>tag for admin.AFIK style tag Helper doesn’t support child content only url to css file is supported.
I guess it’s browser’s default behavior to render
HTMLIf<head>contains renderable HTML tagsIMO we need to keep
<zone name=“Header”>in<head>AFAIK
HEADERshould be rendered inside<head>unless it means the header of the website