IHP Api Reference
Copyright(c) digitally induced GmbH 2021
Safe HaskellNone

IHP.PageHead.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 (project.title)

Inside your layout use it like:

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

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

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

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

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

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

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