kirbycode/media-hub 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kirbycode/media-hub

Composer 安装命令:

composer require kirbycode/media-hub

包简介

Centralized media library for Kirby CMS 5 — WordPress-style asset management with folder organisation, metadata, search, and a custom picker field.

README 文档

README

A centralized media library plugin for Kirby CMS 5 — WordPress-style asset management built directly into the Panel.

Kirby Media Hub — Panel overview

Kirby Media Hub — File metadata

Features

  • Dedicated Panel area — a full-screen Media Hub accessible from the Kirby sidebar
  • Folder organisation — create and delete subfolders to keep assets tidy
  • Drag-and-drop upload — upload files directly to any folder
  • Full-text search — searches filename, title, alt text, description, copyright, and photographer fields simultaneously
  • File metadata — edit title, alt text, description, copyright, photographer, and upload date per file
  • mediahubpicker field — a custom field type that lets any blueprint pick files from the Media Hub
  • UUID-based references — saved as file://uuid — identical format to Kirby's native files field
  • Works inside structure fields — the inline picker does not conflict with Kirby's dialog close handlers
  • Usage tracking — see every page that references a given file
  • Dashboard stats — total files, unused files, file-type breakdown, recent uploads, largest files
  • Auto-refresh stats — counters update immediately after upload or delete
  • No build step — pure PHP + Vue 3 template strings, drops straight into site/plugins/

Requirements

  • Kirby CMS 5.0 or higher
  • PHP 8.1 or higher

Installation

Composer (recommended)

composer require kirbycode/media-hub

Manual

  1. Download or clone this repository.
  2. Copy the media-hub-pro folder into your site's site/plugins/ directory.
  3. The plugin auto-creates content/media-hub/ on the first page load — no further setup needed.

Configuration

All options go in your site's config/config.php:

return [
    // Change the slug of the hub root page (default: 'media-hub').
    // Useful if your site already has a page at that slug.
    'kirbycode.media-hub.root-slug' => 'media-hub',
];

Blueprint Usage

Add the mediahubpicker field type to any page or file blueprint:

Single image picker

fields:
  hero_image:
    label: Hero Image
    type: mediahubpicker
    multiple: false
    accept: image

Multi-select gallery

fields:
  gallery:
    label: Gallery
    type: mediahubpicker
    multiple: true
    accept: image
    help: Pick images from the Media Hub

Document / PDF picker

fields:
  brochure:
    label: Download
    type: mediahubpicker
    multiple: false
    accept: document

Field options

Option Type Default Description
multiple bool true Allow selecting more than one file
accept string (all) Filter picker to a type: image, document, video, audio
label string Media Hub Files Panel field label
help string Help text shown below the field

What gets saved

The field writes a standard Kirby YAML list of file:// UUIDs to the content .txt file — the same format as Kirby's built-in files field:

Hero_image:

- file://abc123def456

Supported File Types

Category Extensions
Images jpg, jpeg, png, gif, webp, svg, avif
Documents pdf, doc, docx, xls, xlsx, ppt, pptx, txt
Video mp4, mov, webm, avi
Audio mp3, wav, ogg, m4a
Archives zip, gz, tar
Design ai, eps, psd

How It Works

The plugin registers a Kirby content page at content/media-hub/ (created automatically on first load). Subfolders are standard Kirby child pages. Files are stored using Kirby's native file system with .txt metadata sidecars.

The Panel area is a custom Kirby area with Vue 3 components (no build step — uses Kirby's bundled runtime). Ten REST API routes under /api/media-hub/ handle all operations.

Changelog

See CHANGELOG.md.

License

MIT — Shivlal Sheladiya

Credits

Built with Kirby CMS by kirbycode.com.

If this plugin saves you time, consider sponsoring further development.

kirbycode/media-hub 适用场景与选型建议

kirbycode/media-hub 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 06 月 09 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「media」 「cms」 「kirby」 「asset-management」 「kirby-plugin」 「media-library」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 kirbycode/media-hub 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 kirbycode/media-hub 我们能提供哪些服务?
定制开发 / 二次开发

基于 kirbycode/media-hub 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 33
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: JavaScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-09