{eucookies:text:accept:more:link:callback:disagree:type}

Description

Adds an EU cookie-consent banner to the page. The inline result is always an empty string - this is a side-effect command: it registers a footer script that holds the banner config, optional inline CSS for positioning, and the smart-eu-cookies JavaScript library. The banner only appears once the page is assembled, so the site template must contain generate HEAD and generate FOOT. All parameters are optional; called bare it shows a default English banner. Labels are passed verbatim, so localize them yourself (for a Czech site write Czech text and button labels). The type parameter controls placement.

Parameters

text optional default built-in English message

The consent message shown in the banner.

accept optional default built-in (OK)

Label of the button that accepts cookies.

more optional default (none)

Label of the more-information link (for example Read more). Pair it with link.

link optional default (none)

URL the more-information link points to (for example /cz/cookies).

callback optional default (none)

Name of a JavaScript function called when the visitor accepts or rejects. Passed into the config without quotes, so give a bare function name.

disagree optional default (none)

Label of the reject button. Omit it and no reject button is shown.

type optional default fixed bottom

Banner placement. Without it the banner is fixed at the bottom of the viewport.

Examples

test[{eucookies}]
Expected[]
Actual[]
The canonical real-world use: a bare call placed before generate FOOT in the site template. It registers the banner and returns nothing inline, so wrapped in brackets the result is empty.
test[{eucookies:This website uses cookies.:I agree}]
Expected[]
Actual[]
First parameter is the message, second is the accept-button label. On a Czech site you would write Czech text here (accented letters render fine on the live page).
test[{eucookies:We use cookies.:OK:Read more:/en/cookies}]
Expected[]
Actual[]
Parameters three and four add a more-information link: the third is its label, the fourth is the URL it points to.
test[{eucookies:We use cookies.:Accept::::Reject}]
Expected[]
Actual[]
The sixth parameter (disagree) adds a reject button. The empty segments skip more, link and callback. Omit disagree and no reject button is shown.
test[{eucookies:::::logChoice}]
Expected[]
Actual[]
The fifth parameter is a JavaScript function name, called when the visitor accepts or rejects. It is injected without quotes, so give a bare existing function name (here logChoice).
test[{eucookies:We use cookies.:OK:::::topblock}]
Expected[]
Actual[]
The seventh parameter sets placement. topblock puts the banner in the normal page flow at the top and wraps its contents full-width; top and block do one of those. Without it the banner is fixed at the bottom.
test[{eucookies:}]
Expected[]
Actual[]
Every parameter is optional and an empty call does not error - it just registers the default banner and returns an empty string inline.