PhoenixKit.Modules.Publishing.PublishingGroup (phoenix_kit v1.7.71)

Copy Markdown View Source

Schema for publishing groups (blog, faq, legal, etc.).

Each group contains posts and defines the content mode (timestamp or slug). Extensible settings are stored in the data JSONB column.

Data JSONB Keys

  • type - Group type: "blogging", "faq", "legal", or custom string
  • item_singular - Display name for single item (e.g., "Post", "Article")
  • item_plural - Display name for multiple items (e.g., "Posts", "Articles")
  • description - Group description
  • icon - Heroicon name for admin UI
  • settings - Group-specific settings map
  • comments_enabled - Whether comments are enabled for this group
  • likes_enabled - Whether likes are enabled for this group
  • views_enabled - Whether view tracking is enabled for this group

Summary

Functions

Changeset for creating or updating a publishing group.

Returns whether comments are enabled for this group.

Returns the group description.

Returns the group icon name.

Returns the plural item name (e.g., 'Posts').

Returns the singular item name (e.g., 'Post').

Returns the group type from data (blogging/faq/legal/custom).

Returns whether likes are enabled for this group.

Returns whether view tracking is enabled for this group.

Types

t()

@type t() :: %PhoenixKit.Modules.Publishing.PublishingGroup{
  __meta__: term(),
  data: map(),
  inserted_at: DateTime.t() | nil,
  mode: String.t(),
  name: String.t(),
  position: integer(),
  posts: term(),
  slug: String.t(),
  updated_at: DateTime.t() | nil,
  uuid: UUIDv7.t() | nil
}

Functions

changeset(group, attrs)

Changeset for creating or updating a publishing group.

comments_enabled?(publishing_group)

Returns whether comments are enabled for this group.

get_description(publishing_group)

Returns the group description.

get_icon(publishing_group)

Returns the group icon name.

get_item_plural(publishing_group)

Returns the plural item name (e.g., 'Posts').

get_item_singular(publishing_group)

Returns the singular item name (e.g., 'Post').

get_type(publishing_group)

Returns the group type from data (blogging/faq/legal/custom).

likes_enabled?(publishing_group)

Returns whether likes are enabled for this group.

views_enabled?(publishing_group)

Returns whether view tracking is enabled for this group.