PhoenixKit.WebsiteAccess.Notice (phoenix_kit v2.22.0)

Copy Markdown View Source

The visitor notice: a bar fixed along the bottom of every page — an icon, a line of text, an optional link. "This is the development site; the live one is at …". Everyone sees it, admins included, so they see what visitors see.

It is injected into every HTML 200 by the website-access plug (the same way core injects its websocket fix), so a host's own layouts carry it without any work. data-phoenix-kit-notice on the element lets a host hide or restyle it. The settings are read through the settings cache: the plug asks on every page.

Summary

Functions

The banner as safe HTML, or nil when the notice is off. preview: true renders it from the saved text whether or not the switch is on (the settings page shows what it will look like before switching it on).

Functions

enabled?()

@spec enabled?() :: boolean()

enabled_key()

html(opts \\ [])

@spec html(keyword()) :: String.t() | nil

The banner as safe HTML, or nil when the notice is off. preview: true renders it from the saved text whether or not the switch is on (the settings page shows what it will look like before switching it on).

icon()

@spec icon() :: String.t()

icon_key()

icons()

link()

@spec link() :: String.t() | nil

switched_on?()

@spec switched_on?() :: boolean()

text()

@spec text() :: String.t()

text_key()