Copyright(c) digitally induced GmbH 2021
Safe HaskellNone

IHP.PageTitle.ControllerFunctions

Description

 
Synopsis

Documentation

setTitle :: (?context :: ControllerContext) => Text -> IO () Source #

Sets the page title. Can be accessed using '{pageTitle}' inside your Layout.hs.

Example:

action ShowProjectAction { projectId } = do
    project <- fetch projectId
    setTitle (get #title project)

Inside your layout use it like:

defaultLayout :: Html -> Html
defaultLayout inner = [hsx|
<head>
    <title>{pageTitle}</title>
</head>
|]