Browse Source

Merge pull request #15625 from abpframework/pr-15611-fix

Fix Url check from in #15611
pull/15633/head
Engincan VESKE 4 years ago
committed by GitHub
parent
commit
7eb7a1f3ad
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 21
      docs/en/UI/Blazor/Basic-Theme.md
  2. 2
      modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/FirstLevelNavMenuItem.razor

21
docs/en/UI/Blazor/Basic-Theme.md

@ -85,6 +85,27 @@ You can simply override the styles in the Global Styles file of your application
See the [Customization / Overriding Components](Customization-Overriding-Components.md) to learn how you can replace components, customize and extend the user interface. See the [Customization / Overriding Components](Customization-Overriding-Components.md) to learn how you can replace components, customize and extend the user interface.
### Overriding the Menu Item
Basic theme supports overriding a single menu item with a custom component. You can create a custom component and call `UseComponent` extension method of Basic Theme in the **MenuContributor**.
```csharp
using Volo.Abp.AspNetCore.Components.Web.BasicTheme.Navigation;
//...
context.Menu.Items.Add(
new ApplicationMenuItem("Custom.1", "My Custom Menu", "#")
.UseComponent(typeof(MyMenuItemComponent)));
```
```html
<li class="nav-item">
<a href="#" class="nav-link">
My Custom Menu
</a>
</li>
```
### Copy & Customize ### Copy & Customize
You can run the following [ABP CLI](../../CLI.md) command in **Blazor{{if UI == "Blazor"}}WebAssembly{{else}} Server{{end}}** project directory to copy the source code to your solution: You can run the following [ABP CLI](../../CLI.md) command in **Blazor{{if UI == "Blazor"}}WebAssembly{{else}} Server{{end}}** project directory to copy the source code to your solution:

2
modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/FirstLevelNavMenuItem.razor

@ -13,7 +13,7 @@
{ {
<DynamicComponent Type="@customComponentType" /> <DynamicComponent Type="@customComponentType" />
} }
else if (url != null) else if (MenuItem.Url != null)
{ {
<li class="nav-item @cssClass @disabled" id="@elementId"> <li class="nav-item @cssClass @disabled" id="@elementId">
<a class="nav-link" href="@url" target="@MenuItem.Target"> <a class="nav-link" href="@url" target="@MenuItem.Target">

Loading…
Cancel
Save