Extension Methods
UmbNav provides extension methods on `UmbNavItem` for programmatic rendering and URL generation. These are useful when you need more control than the TagHelper provides.
Available Methods
Url()
string Url(string? culture = null, UrlMode mode = UrlMode.Default)Parameter
Type
Default
Description
// Basic usage
var url = item.Url();
// Output: "/about-us/"
// With culture
var url = item.Url("da-DK");
// Output: "/da/om-os/"
// Absolute URL
var url = item.Url(mode: UrlMode.Absolute);
// Output: "https://example.com/about-us/"IsActive()
Parameter
Type
Default
Description
GetLinkHtml()
Parameter
Type
Default
Description
GetItemHtml()
Usage Examples
Basic Navigation
With Active State
Bootstrap Dropdown
Building URLs Programmatically
Conditional Rendering
With Images
Multi-Language Support
Combining with Menu Builder Service
Extension Methods vs TagHelper
Feature
Extension Methods
TagHelper
Namespace
Last updated
Was this helpful?