View Source Beacon.Web.BeaconAssigns (Beacon v0.2.1)

Read-only container of Beacon assigns related to the current page.

Available as @beacon

This data can be accessed in page templates, event handlers, and other parts of your site to read information about the current page as the current site, path and query params, path and title.

More fields may be added in the future.

Examples

In a template:

<h1><%= @beacon.page.title %></h1>

In a event handler:

pages = Beacon.Content.list_published_pages(@beacon.site)

Summary

Types

@type t() :: %Beacon.Web.BeaconAssigns{
  page: %{path: String.t(), title: String.t()},
  path_params: %{required(String.t()) => term()},
  private: map(),
  query_params: %{required(String.t()) => term()},
  site: Beacon.Types.Site.t()
}