Publishing 0.12.0: Media folders for groups and posts, and tree pickers for categories
Publishing 0.12.0 can keep each publishing group’s files, and optionally each post’s, in their own folder of the site’s Media library. Category parents are now chosen from a tree, and every admin page shows the same header trail.
Media folders per group and post
This is opt-in. Set the parent folder hook in your config, and each group gets a folder in the Media library. The module ships a ready-made pair of hooks that makes a Publishing folder with one folder per group, named after the group:
config :phoenix_kit_publishing,
attachments_parent_folder: {PhoenixKit.Modules.Publishing.MediaFolders, :module_folder},
attachments_folder_name: {PhoenixKit.Modules.Publishing.MediaFolders, :folder_name}
Add config :phoenix_kit_publishing, :post_media_folders, true and each post also gets its own folder inside its group’s, named after its slug, or its date and time for a timestamp post.
Once configured, every file you pick in the editor, whether for a slot, an <Image>, an <Audio> or a gallery image, is filed into the post’s or group’s folder. This happens in the background; a failure is logged and never interrupts editing. The group and the post remember their folder by its ID, so renaming or moving the folder in the Media browser later keeps it attached.
For files your posts already use, run mix phoenix_kit_publishing.media.adopt. It is a dry run by default; add --apply to file them. It can be run again safely and never changes a file’s URL. If you change the hooks later, core’s mix phoenix_kit.media.reorganize moves the group folders, and it reports folders left over from trashed groups and posts.
Categories and navigation
The parent field of the category form and the Move to… dialog now use a tree picker instead of an indented list. Every admin page follows core’s header trail: Publishing, then the group, the post and the page. The group edit page opens on the language you were viewing.
Fixes
- Moving a category to an invalid parent returns an error instead of crashing.
- Two categories moved under one parent at the same moment no longer take the same position.
- Renaming a category from an outdated form no longer moves it back to its old parent.
- The translation editor no longer crashes for a signed-out user.
- Fixing a stale group no longer overwrites newer group data, such as the media folder.
Upgrading
Publishing 0.12 needs PhoenixKit 2.38.0 or later; an older core cannot compile it. There is no migration. Without the media folder config nothing changes on your site.
Full release notes: Publishing 0.12.0
0.12.0 · 26 September 2026
Added
- Group media folders (
MediaFolders), opt-in per host. Withconfig :phoenix_kit_publishing, attachments_parent_folder: …set, each group gets a folder in the site’s Media library (ready-made hooks:Publishing/<group name>). The group keeps the folder’s uuid indata["media_folder_uuid"], so renaming or moving the folder later keeps it attached. With:post_media_foldersalso set, each post gets its own folder inside its group’s (Publishing/<group>/<post slug or date>), with the pointer stored on every version. No migration. Nothing happens on a host that has not opted in. - The editor files every media pick (slot,
<Image>,<Audio>, each image of a gallery) into the post’s or group’s folder, in a supervised task. A failure is logged and never interrupts the edit. MediaAdoptionandmix phoenix_kit_publishing.media.adopt [--apply]file the media that posts already use into their folders. It is a dry run by default, safe to repeat, and never changes a file URL.MediaReorganizer, registered throughmedia_reorganizer/0, lets core’smix phoenix_kit.media.reorganizemove group folders when the host’s hooks change. It also reports orphan folders of trashed groups and posts, and groups whose files are still outside their folder.
Changed
- The category form’s parent and the “Move to…” dialog use core’s
TreePickerinstead of indented flat selects. Both trees are built from the category list the page already holds, so opening a dialog no longer queries the database. - Every admin page follows core’s header trail
(
Publishing / <group> / <post> / <page>). The editor’s post crumb follows the saved title. - The actor is read through
PhoenixKitWeb.Actor, and activity-log errors are handled by core’sActivity.log/1. - Edit Group opens on the language being viewed.
- The
phoenix_kitfloor is now 2.38.0, written as>= 2.38.0 and < 3.0.0. It is required forStorage.ResourceFolders,TreePicker,PhoenixKitWeb.Actorandmount_multilang(open_on:). Dependencies are refreshed (phoenix_kit2.40.1,phoenix_kit_ai0.24.1,mdex0.14.0,phoenix1.8.15).
Fixed
- A category move to a non-uuid parent, or a crafted category id, returns
:not_foundor:parent_not_foundinstead of raising a cast error. - Two category moves under one parent at the same moment could take the same position. The position is now resolved under the group lock.
- A category rename submitted on a stale form no longer moves the category back to its old parent.
- The translation editor crashed on a signed-out scope.
StaleFixer.fix_stale_group/1overwrote groupdatakeys written after the group was loaded, including the media folder pointer.
Publishing 0.12.0. Install or update: {:phoenix_kit_publishing, "~> 0.12"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.