PhoenixKit.Modules.Publishing.PublishingGroup (PhoenixKitPublishing v0.4.3)

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: "blog", "faq", "legal", or "custom"
  • 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
  • featured_enabled - Whether featured posts are surfaced on this group's public listing (default true). When false, posts flagged featured render inline like any other post — no hero band, no pinning.
  • featured_layout - How featured posts render: "hero" (a band above the grid) or "card" (a larger card within the grid). Default "hero".
  • newest_enabled - Whether the most recent post is pulled out of the grid into its own "Latest" band under any featured posts and shown larger (default false).
  • newest_layout - How the latest post renders: "hero" (a band above the grid) or "card" (a larger card within the grid). Default "hero".
  • featured_style - The paint of featured-band cards, orthogonal to the layout: "classic", "cover", "cover_panel", "minimal", or "top". Default "classic".
  • newest_style - Same vocabulary for the Latest band. Default "classic".
  • scrollbar_style - Native scrollbar styling for this group's public pages: "default" (untouched), "branded" (theme-colored), or "thin". Never replaces native scroll — only recolors/resizes the real bar. Default "default".
  • scroll_progress_enabled - Show a reading-progress bar on post pages (default false).
  • scroll_headings_enabled - Show a heading-anchor rail on post pages (default false).
  • scroll_timeline_enabled - Show a date-timeline rail on the listing (default false).
  • scroll_timeline_granularity - Timeline marker resolution: "auto" (fit to the posts' date span), "year", "month", or "day". Default "auto".
  • listing_sort - Public listing order: "newest" or "oldest" by effective publish date (post date for timestamp groups, published-at for slug groups). Default "newest".
  • show_breadcrumbs - Show the breadcrumb trail on this group's public listing and post pages (default false).
  • post_date_position - Where a post's date renders relative to the title on the post page: "above", "below", or "hidden". Default "below".
  • post_width - Post-page content column width: "narrow", "normal", or "wide". Default "normal".
  • show_featured_image - Show the post's featured image at the top of the post page (default false).
  • show_reading_time - Show an estimated reading time on the post page (default false).
  • show_tags - Show the post's tags on the post page (default false).
  • show_post_count - Show the total post count under the title on the group's public listing (default false).
  • show_top_back_link - Show the subtle "Back to <group>" link at the top of the post page, mirroring the footer button (default true).
  • listing_image_links - Make the post-card images on the public listing click through to the post, same as the title (default true).
  • listing_animations - Hover animations on listing cards (a subtle lift + shadow cue that the card is clickable; default true). Motion-reduce users never see the lift regardless.
  • name_i18n - Per-language overrides for the group's display name, keyed by language code (e.g. %{"et" => "Blogi"}). The primary-language name lives in the name column; secondary languages fall back to it when absent. The slug is intentionally NOT translated — it stays a single canonical URL segment.

Summary

Functions

Changeset for creating or updating a publishing group.

Returns whether comments are enabled for this group.

Returns whether featured posts are surfaced on this group's listing (default true).

Returns the featured-post layout for this group ("hero" or "card"; default "hero").

Returns the featured-band style ("classic"/"cover"/"cover_panel"/"minimal"/"top"; default "classic").

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 (blog/faq/legal/custom).

Returns whether likes are enabled for this group.

Returns whether listing cards animate on hover (default true).

Returns whether listing card images click through to the post (default true).

Returns the public-listing sort order for this group ("newest"/"oldest"; default "newest").

Returns the per-language display-name overrides map (language code => name).

Returns whether the latest post is surfaced in its own listing band (default false).

Returns the latest-post layout for this group ("hero" or "card"; default "hero").

Returns the Latest-band style (same vocabulary as featured_style; default "classic").

Returns where a post's date renders relative to the title ("above"/"below"/"hidden"; default "below").

Returns the post-page content width ("narrow"/"normal"/"wide"; default "normal").

Returns whether the heading-anchor rail shows on this group's post pages (default false).

Returns whether the reading-progress bar shows on this group's post pages (default false).

Returns whether the date-timeline rail shows on this group's listing page (default false).

Returns the date-timeline granularity ("auto"/"year"/"month"/"day"; default "auto").

Returns the scrollbar style for this group's public pages ("default"/"branded"/"thin").

Returns whether the breadcrumb trail shows on this group's public pages (default false).

Returns whether a post's featured image shows at the top of the post page (default false).

Returns whether the post count shows on the group's public listing (default false).

Returns whether an estimated reading time shows on the post page (default false).

Returns whether a post's tags show on the post page (default false).

Returns whether the top back link shows on the post page (default true).

Returns the group's display name in lang, falling back to the primary-language name column when there's no translation for that language.

Returns whether view tracking is enabled for this group.

Types

t()

@type t() :: %PhoenixKit.Modules.Publishing.PublishingGroup{
  __meta__: term(),
  data: map(),
  description_i18n: term(),
  inserted_at: DateTime.t() | nil,
  mode: String.t(),
  name: String.t(),
  position: integer(),
  posts: term(),
  slug: String.t(),
  status: String.t(),
  title_i18n: term(),
  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 (blog/faq/legal/custom).

likes_enabled?(publishing_group)

Returns whether likes are enabled for this group.

listing_animations?(publishing_group)

Returns whether listing cards animate on hover (default true).

listing_image_links?(publishing_group)

Returns whether listing card images click through to the post (default true).

listing_sort(publishing_group)

Returns the public-listing sort order for this group ("newest"/"oldest"; default "newest").

name_translations(publishing_group)

Returns the per-language display-name overrides map (language code => name).

newest_enabled?(publishing_group)

Returns whether the latest post is surfaced in its own listing band (default false).

newest_layout(publishing_group)

Returns the latest-post layout for this group ("hero" or "card"; default "hero").

newest_style(publishing_group)

Returns the Latest-band style (same vocabulary as featured_style; default "classic").

post_date_position(publishing_group)

Returns where a post's date renders relative to the title ("above"/"below"/"hidden"; default "below").

post_width(publishing_group)

Returns the post-page content width ("narrow"/"normal"/"wide"; default "normal").

scroll_headings_enabled?(publishing_group)

Returns whether the heading-anchor rail shows on this group's post pages (default false).

scroll_progress_enabled?(publishing_group)

Returns whether the reading-progress bar shows on this group's post pages (default false).

scroll_timeline_enabled?(publishing_group)

Returns whether the date-timeline rail shows on this group's listing page (default false).

scroll_timeline_granularity(publishing_group)

Returns the date-timeline granularity ("auto"/"year"/"month"/"day"; default "auto").

scrollbar_style(publishing_group)

Returns the scrollbar style for this group's public pages ("default"/"branded"/"thin").

show_breadcrumbs?(publishing_group)

Returns whether the breadcrumb trail shows on this group's public pages (default false).

show_post_count?(publishing_group)

Returns whether the post count shows on the group's public listing (default false).

show_reading_time?(publishing_group)

Returns whether an estimated reading time shows on the post page (default false).

show_tags?(publishing_group)

Returns whether a post's tags show on the post page (default false).

show_top_back_link?(publishing_group)

Returns whether the top back link shows on the post page (default true).

translated_name(group, lang)

Returns the group's display name in lang, falling back to the primary-language name column when there's no translation for that language.

Matching is base-language tolerant: the admin form stores overrides under the full language code (e.g. "fr-FR") while the public side resolves by the short code ("fr"), so a lookup succeeds when either side uses the full or short form (as long as the base is unambiguous).

views_enabled?(publishing_group)

Returns whether view tracking is enabled for this group.