happstack-helpers-0.52: Convenience functions for Happstack.

Happstack.Helpers.HtmlOutput.Menu

Synopsis

Documentation

menuLink :: Request -> (String, String) -> StringSource

Render a link which changes color when the current page is active, modulo css.

menuLink rq (url,anchortext)

similar to simpleLink, outputs an html link. However, menuLink looks at the request to determine if the page being linked to is the current page. If it is, it's in class menuitemSelected, otherwise class menuitem. if the url is blank, the link is unclickable, just displayed gray (e.g., features that haven't been enabled but are coming soon). You need to define the classes described here via css for these features to be useful. I usually do something like in a global css file:

a.menuitem:link {color: blue}

a.menuitem:active {color: blue}

a.menuitem:visited {color: blue}

a.menuitem:hover {color: blue}

a.menuitemSelected:link {color: purple}

a.menuitemSelected:active {color: purple}

a.menuitemSelected:visited {color: purple}

a.menuitemSelected:hover {color: purple}

menuLink' :: String -> String -> Request -> (String, String) -> StringSource

menuLink' classSelected classUnselected rq (url,anchortext) = ...

hMenuBars :: Request -> [(String, String)] -> StringSource

hMenuBars rq = paintHBars . map (menuLink rq)