PhoenixKit. Modules. Publishing. Web. Editor. Helpers
(PhoenixKitPublishing v0.1.16)
Copy Markdown
View Source
Shared helper functions for the publishing editor.
Contains utilities for URL building, language handling, virtual post creation, and other common operations.
Summary
Functions
Assigns current language with enabled/known status.
Builds the URL for the post editor.
Builds language data for the publishing_language_switcher component.
Builds the URL for creating a new post.
Builds the URL for a post overview page.
Builds the URL for the post preview.
Builds the public URL for a post.
Builds a virtual post for new post creation.
Builds a virtual translation for a new language.
Gets the editor language from assigns.
Gets the preview URL for a featured image.
Formats a list of language codes for display.
Gets the language name for a language code.
Builds the inline <Image> PHK component markup for a storage file.
Sanitizes a featured image ID value.
Functions
Assigns current language with enabled/known status.
Builds the URL for the post editor.
Options: :version, :lang
Builds language data for the publishing_language_switcher component.
Builds the URL for creating a new post.
Builds the URL for a post overview page.
Builds the URL for the post preview.
Builds the public URL for a post.
Builds a virtual post for new post creation.
Builds a virtual translation for a new language.
Gets the editor language from assigns.
Gets the preview URL for a featured image.
Formats a list of language codes for display.
Gets the language name for a language code.
Builds the inline <Image> PHK component markup for a storage file.
The component carries the file UUID, not a resolved URL — the renderer
(PhoenixKit.Modules.Shared.Components.Image) resolves it to a URL at render
time via Storage.get_public_url_by_uuid/2. Storing the UUID instead of a
signed URL keeps the reference stable across url_prefix changes,
secret_key_base rotation, and content moved between environments — the same
late-resolution the featured image already uses.
Alt text is derived from the file's original name (falling back to "Image"),
sanitised so it can't break out of the XML attribute.
Sanitizes a featured image ID value.