Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Images into Side Nav #713

Closed
timd19 opened this issue Mar 30, 2019 · 10 comments
Closed

Add Images into Side Nav #713

timd19 opened this issue Mar 30, 2019 · 10 comments
Labels
bounty enhancement New feature or request help wanted Looking for contributors to resolve this issue
Milestone

Comments

@timd19
Copy link

timd19 commented Mar 30, 2019

On the Materialize website https://materializecss.com/sidenav.html

Would be nice to add the image and user information at the top (click demo).

image

@adamdriscoll adamdriscoll added the enhancement New feature or request label Apr 2, 2019
@adamdriscoll adamdriscoll added bounty help wanted Looking for contributors to resolve this issue labels Aug 12, 2019
@blurpiflurp
Copy link

blurpiflurp commented Aug 23, 2019

So something like this?

preview

With options to add an e-mail/background.

$Navigation = New-UDSideNav -Content {
    New-UDSideNavItem -Text "My First Page" -PageName "Page Name" -Image "https://cdn.pixabay.com/photo/2014/04/03/10/32/user-310807_960_720.png"
    New-UDSideNavItem -Subheader -Text "Subheader"
    New-UDSideNavItem -Text "My Second Page" -PageName "Page Name 2" -Image "https://cdn.pixabay.com/photo/2017/01/20/17/26/operating-system-1995434_960_720.png"
    New-UDSideNavItem -Divider
    New-UDSideNavItem -Text "Google" -Url 'https://www.google.com' -Icon Users
} -Fixed

@awickham10
Copy link

awickham10 commented Aug 23, 2019

Is -Text required? I have a use case where I would like a logo in the top left and this would work as long as the -Text parameter is not required.

@blurpiflurp
Copy link

I don't know actually. Not really but it might be set to as a mandatory field atm...
However this addition would need some css ninja to make it nice since its not really aligned at all and I have no interest to learn that but I've seen what @psDevUK did with the azure theme and maybe he could look at that...

@psDevUK
Copy link
Contributor

psDevUK commented Aug 29, 2019

I’m no css ninja but would be an honour to help out in anyway possible. Just let me know if you got your own fork page or where I can get this from. Thanks

Amazing work by the way for solving this conundrum

@psDevUK
Copy link
Contributor

psDevUK commented Aug 29, 2019

Yo @oitptobbe if you upload this to your github then let me know. I will do my best to make it look pretty then PR it back to you?

@blurpiflurp
Copy link

blurpiflurp commented Aug 29, 2019

@psDevUK Yes I will upload the code tomorrow if I can. Might be delayed until Saturday depending on if I can get another issue solved or if I give up.

Iirc the issue is that when we add a image to said sidebar I also add the id “user-view” because otherwise the circle tag for the image doesn’t work.

I’m guessing that a offset for user-view will fix the whole issue but...

@psDevUK
Copy link
Contributor

psDevUK commented Aug 29, 2019

@oitptobbe aka obi wan kenobi whenever you ready I will be very interested to see this. Well done again

@blurpiflurp
Copy link

Was checking what I had broken because it would not collapse... Then I noticed I had a -fixed parameter on new-udsidenav...

Not sure why but now the elements are aligned it looks like. I'll submit a PR for this anyways.

If you want to play around @psDevUK then go ahead. Its in my fork now.

Import-Module c:\users\fr1200\source\repos\universal-dashboard\src\output\UniversalDashboard.Community.psd1
$Page1 = New-UDPage -Name "Page Name" -Content { New-UDCard -Id 'page-1' }
$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" -Image "https://cdn.pixabay.com/photo/2014/04/03/10/32/user-310807_960_720.png" -background "https://materializecss.com/images/office.jpg"
    New-UDSideNavItem -Subheader -Text "Subheader"
    New-UDSideNavItem -Text "My Second Page" -PageName "Page Name 2" -Image "https://cdn.pixabay.com/photo/2017/01/20/17/26/operating-system-1995434_960_720.png"
    New-UDSideNavItem -Divider
    New-UDSideNavItem -Text "Google" -Url 'https://www.google.com' -Icon Users
} -Fixed


$dash = New-UDDashboard -Title "Navigation" -Pages @($Page1, $Page2) -Navigation $Navigation

Get-UDDashboard|Stop-UDDashboard
Start-UDDashboard -port 8000 -Dashboard $dash -Name 'dash' -AutoReload

Preview background, image & text

And this is without the text for the first navitem.

Preview without text

It also works now without a background image.

Preview without text and background

blurpiflurp pushed a commit to blurpiflurp/universal-dashboard that referenced this issue Aug 30, 2019
adamdriscoll added a commit that referenced this issue Aug 30, 2019
@adamdriscoll
Copy link
Member

@oitptobbe - Can you click claim on here? https://www.bountysource.com/issues/72155079-add-images-into-side-nav

@adamdriscoll adamdriscoll added this to the 2.6.0 milestone Aug 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bounty enhancement New feature or request help wanted Looking for contributors to resolve this issue
Projects
None yet
Development

No branches or pull requests

5 participants