Hi, I have a couple of different things to ask about, I don’t know if these should be different topics or not, if so, please let me know.
First, I am trying to add a permanent AppBar / Drawer to my dashboard.
I tried with using the Drawer, and -Navigation $Navigation -NavigationLayout permanent, which adds the bar like I want.
When I then tried to exclude different items in the bar based on $Roles, it doesn’t work, as $Roles seems to be populated first after New-UDPage has run.
I then switched to AppBar, which works with $Roles, but I can not make it permanent, without it creating a new header.
Is there some way to work with $Roles when using -Navigation $Navigation -NavigationLayout permanent, or is there some way to make the AppBar permanent?
Secondly I am wondering if “-Icon” is broken for Show-UDToast?
I can not make any icon visible, neither with just Show-UDToast -Icon "ad"
nor Show-UDToast -Icon (New-UDIcon -Icon "ad")
When I then tried to exclude different items in the bar based on $Roles , it doesn’t work, as $Roles seems to be populated first after New-UDPage has run.
We need to fix this. It shouldn’t work that way. I’ll take a look at what we can do there. The problem is we have to adjust the page to make a permanent bar so adding it using the New-AppBar method isn’t going to work.
Secondly I am wondering if “-Icon” is broken for Show-UDToast?
Unfortunately, this looks like a bug as well. I’ll get both of these added to our backlog to be resolved.
Im starting my conversion to v3 and a little stuck here… It appears to customise the top nav bar you need to use New-AppBar command and add content in (images etc), this runs from inside the New-UdPage which causes issues as i cannot find a way to then fix the drawer (side nav) and stop it going to a hamburger. If i use the drawer inside the dashboard code, then at the end of New-UdPage add ‘-NavigationLayout permanent -Navigation $Navigation’ i have a fixed bar, but i cannot customise the Appbar anymore…
I tried playing with CSS, but adding z-index 9999 to the appbar inside the page, but i guess this doesnt work as the main appbar from the dashboard is also set to 9999.
Is there a way to make the side nav permanent, but also allow the top bar to be customised with icons and images etc?
Is there a way to use the New-UdDashboard -Stylesheets to do this? i cant seem to find any documentation on this -stylesheets parameter and what i do add to that is not working.
I did also try this thread: Pinning the App Bar , this did allow me to have a fixed bar with custom navbar, but the formatting is all over the place, even when using UdContainer.
I also worked out the CSS stuff, so now i have a way to do this, actually fairly easily but @psDevUK your plugin is a huge enhancement on my current method, I honestly dont think your timing could be better here! I will certainly give that a go!
Hi @neo glad to hear this component will come into use for you if you adjust the -BottomBoundary parameter this should prevent it from being sticky, so will not scroll with the page. As I added a -Content parameter you should be able to basically stick anything inside this navbar. I just tested with my badgelink component as I wanted to emulate the newer UD3+ navbar with fanicier links and badges in it.
On my blog I just wanted to demo the proof of concept that this does work, I am still yet to implement this on my work dashboards…
Hi @neo - I’m trying to do the same thing, using the permanent navigation but customise the app bar (or add a new appbar over the top). Just wondering if you’d be happy to share the CSS you’ve used to accomplish this?
This was fixed for me in an updated a while ago.
Today I create a list of items for the navigation bar, and then use the -loadnavigation parameter with New-UDPage:
I’ve been trying to use the -LoadNavigation to make it dynamic but for some reason I’m getting the following error below. All I’m trying to accomplish here is to display current logged in user from session variable.
Startup: Cannot process argument transformation on parameter 'LoadNavigation'. Cannot convert the "System.Object[]" value of type "System.Object[]" to type "UniversalDashboard.Models.Endpoint".
Jun 21, 2021 5:06 PM Startup: at <ScriptBlock>, C:\ProgramData\UniversalAutomation\Repository\NOC.ps1: line 34
at <ScriptBlock>, <No file>: line 1
Jun 21, 2021 5:06 PM Startup: at System.Management.Automation.ParameterBinderBase.BindParameter(CommandParameterInternal parameter, CompiledCommandParameter parameterMetadata, ParameterBindingFlags flags)
at System.Management.Automation.CmdletParameterBinderController.BindParameter(CommandParameterInternal argument, MergedCompiledCommandParameter parameter, ParameterBindingFlags flags)
at System.Management.Automation.CmdletParameterBinderController.BindParameter(UInt32 parameterSets, CommandParameterInternal argument, MergedCompiledCommandParameter parameter, ParameterBindingFlags flags)
at System.Management.Automation.CmdletParameterBinderController.BindNamedParameter(UInt32 parameterSets, CommandParameterInternal argument, MergedCompiledCommandParameter parameter)
at System.Management.Automation.ParameterBinderController.BindNamedParameters(UInt32 parameterSets, Collection`1 arguments)
at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParametersNoValidation(Collection`1 arguments)
at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParameters(Collection`1 arguments)
at System.Management.Automation.CommandProcessor.BindCommandLineParameters()
at System.Management.Automation.CommandProcessor.Prepare(IDictionary psDefaultParameterValues)
at System.Management.Automation.CommandProcessorBase.DoPrepare(IDictionary psDefaultParameterValues)
at System.Management.Automation.Internal.PipelineProcessor.Start(Boolean incomingStream)
at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input)
--- End of stack trace from previous location ---
at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input)
at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)
at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)