dotnet / dotnet/aspnetcore

HeadContent Append Mode

Open
#55,064 2 comments 3 reactions 0 assignees View on GitHub
area-blazor enhancement feature-blazor-builtin-components feature-blazor-sections
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Is your feature request related to a problem? Please describe the problem.

This was already requested and closed "by design"
https://github.com/dotnet/aspnetcore/issues/51864

For component authoring, it would be ideally to have components that can add to the HeadOutlet individually, specially for adding script tags,for example, GoogleTagManager component.

There's also the problem that if you use 2 HeadOutlets, there's no error at all, only one gets rendered and the other is discarded silently. poor developer experience.

### Describe the solution you'd like

Having 2 HeadContent override each other throws and error.
Opt in into an `Optional` parameter so it doesn't throws and works as today.
Opt in into an `Append` parameter and it appends content to the already existing (or not) HeadOutlet.

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.