Does anyone know if you can make a custom side nav collapsable? From what I have seen and looked at on the docs, you can have the default generated one (which is collapsable), use -none which removes it entirely, or use a custom side nav which has it always there.
Am i missing something or…?
The navbar I posted here is custom and collapsible.
I use the code below to build my navigation dynamically based on Authorization and group memberships. The trade off is that Get-UdAuthorization takes a few seconds to run. So the navigation pane will be empty in a few seconds immediately following a refresh/page load.
I opened an enhancement issue on the speed, or lack thereof yesterday.
$Navigation = New-UDSideNav -Endpoint {
$Policies = Get-UDAuthorizationPolicy
New-UDSideNavItem -Text "Home" -PageName "Home" -Icon home
New-UDSid…
You should be able to salvage from that maybe? Though note that it uses a -endpoint and not -content.
I did see that, but i couldn’t see how in there you made it collapsible with the Hamburger menu like you can with the default one?
Well,I didn’t do anything.
That’s the default behavior.
Can you share the navbar code?
Edit: Of course, right after i post it… i find the problem…
insert expletives here
1 Like
How about removing that -Fixed parameter?
Good work!
I guess I was your rubber duck
In software engineering, rubber duck debugging is a method of debugging code. The name is a reference to a story in the book The Pragmatic Programmer in which a programmer would carry around a rubber duck and debug their code by forcing themselves to explain it, line-by-line, to the duck. Many other terms exist for this technique, often involving different (usually) inanimate objects like pets basically a dog or a cat.
Many programmers have had the experience of explaining a problem to someon...
2 Likes
$Page2 = New-UDPage -Name "Page Name 2" -Content { New-UDCard -Id 'page-2'}
$Navigation = New-UDSideNav -Content {
New-UDSideNavItem -Text "My First Page" -PageName "Page Name" -Icon group
New-UDSideNavItem -Text "My Second Page" -PageName "Page Name 2" -Icon User
New-UDSideNavItem -Text "Google" -Url 'https://www.google.com' -Icon Users
}
$DB1 = New-UDDashboard -Title "Navigation" -Pages @($Page1, $Page2) -Navigation $Navigation
Start-UDDashboard -Name "Nav1" -Dashboard $DB1 -Port 10063```
Adam posted this example that I've been testing with.