View Source Beacon.Content.PageVariant (Beacon v0.2.1)

Stores an alternate template which can be randomly rendered as a replacement for a Page's standard template.

A PageVariant contains three main fields:

  • :name - a brief description of what change(s) the variant template provides
  • :weight - the percentage of page renders which should use this template (0 - 100)
  • :template - the template which should be rendered whenever this variant is used

Do not create or edit page variants manually

Use the public functions in Beacon.Content instead. The functions in that module guarantee that all dependencies are created correctly and all processes are updated. Manipulating data manually will most likely result in inconsistent behavior and crashes.

Summary

Types

@type t() :: %Beacon.Content.PageVariant{
  __meta__: term(),
  id: Ecto.UUID.t(),
  inserted_at: DateTime.t(),
  name: binary(),
  page: Beacon.Content.Page.t(),
  page_id: Ecto.UUID.t(),
  template: binary(),
  updated_at: DateTime.t(),
  weight: integer()
}