EvotecIT/PSWriteHTML

Can't get any HTML objects to display before tabs header

ioamnesia opened this issue · 4 comments

I'd really like to have something above my tabs header so I tried putting the tab in a panel, section, etc and I can't figure out how... Is it possible?

Currently not possible but should be easy to add. Just I never thought it would be needeed. Currently only New-HTMLLogo goes over the tabs. What would be use case for you?

I would like this too.
My use case is a dashboard that gets updated on a schedule.
I want to display a header before the tabs with the time of the last update.

Makes sense. Probably would need to introduce new commands - something along the lines:

New-HTML {
    New-HTMLHead {
          # anything that would need putting over the tabs
    }
    New-HTMLBody {
          New-HTMLTab {
                # typical commands
         }
      
    }
    New-HTMLFooter {

    }
}

Two options:

Import-Module .\PSWriteHTML.psd1 -Force

New-HTML -TitleText 'This is a test' -FilePath "$PSScriptRoot\Example34_02.html" {
    New-HTMLHeader {
        New-HTMLText -Text "Date of this report $(Get-Date)" -Color Blue -Alignment right
    }
    # see, not New-HTMLMain
    New-HTMLTab -TabName 'Test' {
        New-HTMLContent -HeaderText '0 section' {
            New-HTMLPanel {
                New-HTMLTable -ArrayOfObjects $Processes -HideFooter
            }
            New-HTMLPanel {
                New-HTMLTable -DataTable $Processes -HideFooter
            }
            New-HTMLPanel {
                New-HTMLTable -DataTable $Processes -HideFooter -Simplify
            }
            New-HTMLPanel {
                New-HTMLTable -DataTable $Processes -HideFooter
            }
        }
    }
    New-HTMLTab -TabName 'Test5' {
        New-HTMLContent -HeaderText '1 section' {
            New-HTMLPanel {
                New-HTMLTable -ArrayOfObjects $Processes -HideFooter
            }
            New-HTMLPanel {
                New-HTMLTable -ArrayOfObjects $Processes -HideFooter
                # New-HTMLTable -DataTable $Processes -HideFooter
            }
            New-HTMLPanel {
                New-HTMLTable -DataTable $Processes -HideFooter
            }
        }
    }
    New-HTMLFooter {
        New-HTMLText -Text "Date of this report $(Get-Date)" -Color Blue -Alignment right
    }
} -UseCssLinks -UseJavaScriptLinks -ShowHTML

More explicit:

Import-Module .\PSWriteHTML.psd1 -Force

New-HTML -TitleText 'This is a test' -FilePath "$PSScriptRoot\Example34_01.html" {
    New-HTMLHeader {
        New-HTMLText -Text "Date of this report $(Get-Date)" -Color Blue -Alignment right
    }
    New-HTMLMain {
        New-HTMLTab -TabName 'Test' {
            New-HTMLContent -HeaderText '0 section' {
                New-HTMLPanel {
                    New-HTMLTable -ArrayOfObjects $Processes -HideFooter
                }
                New-HTMLPanel {
                    New-HTMLTable -DataTable $Processes -HideFooter
                }
                New-HTMLPanel {
                    New-HTMLTable -DataTable $Processes -HideFooter -Simplify
                }
                New-HTMLPanel {
                    New-HTMLTable -DataTable $Processes -HideFooter
                }
            }
        }
        New-HTMLTab -TabName 'Test5' {
            New-HTMLContent -HeaderText '1 section' {
                New-HTMLPanel {
                    New-HTMLTable -ArrayOfObjects $Processes -HideFooter
                }
                New-HTMLPanel {
                    New-HTMLTable -ArrayOfObjects $Processes -HideFooter
                    # New-HTMLTable -DataTable $Processes -HideFooter
                }
                New-HTMLPanel {
                    New-HTMLTable -DataTable $Processes -HideFooter
                }
            }
        }
    }
    New-HTMLFooter {
        New-HTMLText -Text "Date of this report $(Get-Date)" -Color Blue -Alignment right
    }
} -UseCssLinks -UseJavaScriptLinks -ShowHTML

image

I hopefully didn't break anything.