DrewBrasher.OrchardCore.Blazor
1.0.1
dotnet add package DrewBrasher.OrchardCore.Blazor --version 1.0.1
NuGet\Install-Package DrewBrasher.OrchardCore.Blazor -Version 1.0.1
<PackageReference Include="DrewBrasher.OrchardCore.Blazor" Version="1.0.1" />
<PackageVersion Include="DrewBrasher.OrchardCore.Blazor" Version="1.0.1" />
<PackageReference Include="DrewBrasher.OrchardCore.Blazor" />
paket add DrewBrasher.OrchardCore.Blazor --version 1.0.1
#r "nuget: DrewBrasher.OrchardCore.Blazor, 1.0.1"
#:package DrewBrasher.OrchardCore.Blazor@1.0.1
#addin nuget:?package=DrewBrasher.OrchardCore.Blazor&version=1.0.1
#tool nuget:?package=DrewBrasher.OrchardCore.Blazor&version=1.0.1
Blazor Module
Everything you need to include Blazor components inside the pages, MVC views, and Template Views of your Orchard Core Module.
NOTE: This currently only works with Themes that have Razor layouts like TheTheme. It does not work with Themes like the Blog or Agency Themes that use liquid layouts.
NuGet Package
Usage
Add a refference to the
DrewBrasher.OrchardCore.Blazorproject to your Orchard Core Module.Add
DrewBrasher.OrchardCore.Blazorto the Dependencies of your Module'sManifest.csfile.Dependencies = [ "DrewBrasher.OrchardCore.Blazor" ]Add the tag helper to your
_ViewImports.cshtmlfile:@addTagHelper *, DrewBrasher.OrchardCore.BlazorAdd your component to a page or view:
If your component does not take any parameters you can add it with one line like this:
<blazor-component type="typeof(DemoComponent)" render-mode="ServerPrerendered" />If your component takes parameters you can add it with two lines like this:
<enable-blazor-components render-mode="ServerPrerendered" /> <component type="typeof(DemoComponent)" param-YourParam="YourValue" render-mode="ServerPrerendered" />If your theme uses a Zone other than
HeadMetafor rendering meta data, you can specify the zone like this:<blazor-component type="typeof(DemoComponent)" render-mode="ServerPrerendered" header-zone="YourHeadZoneHere" />or this:
<enable-blazor-components render-mode="ServerPrerendered" header-zone="YourHeadZoneHere" />
Related Solution Projects
DrewBrasher.OrchardCore.Blazor
Everything you need to include Blazor components inside the pages, MVC views, and Template Views of your Orchard Core Module.
OCRazorModuleDemo
This is an Orchard Core CMS Module to demo and test this project. It has an MVC View and a Widget that both use the DemoComponent.
RazorDemo
This is a Razor Class Library with a DemoComponent to use for testing this project.
Contributing
If you would like to help out with this module, here are the steps to test it out:
- Clone this repository
- Setup OC with the default theme (TheTheme)
- Enable the OCRazorModuleDemo feature
- Go to this url to test:
/OCRazorModuleDemo/Home/Index
Credits
Thank you to ApacheTech for the EnableBlazorComponentsTagHelper!
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- OrchardCore.ContentManagement (>= 2.1.6)
- OrchardCore.ContentTypes.Abstractions (>= 2.1.6)
- OrchardCore.DisplayManagement (>= 2.1.6)
- OrchardCore.Module.Targets (>= 2.1.6)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Fixed issue with missing partial views.