MediaHub
MediaHub for Developers
If you've built sites in ProcessWire for any length of time, you've probably worked around its native image fields in situations where they weren't quite the right fit. MediaHub is the shared media library that ProcessWire doesn't ship with, built entirely on top of what ProcessWire already does well, so there's nothing foreign to learn.
How it fits into ProcessWire
Assets are pages. Crops are pages. Collections are pages. Fields on your templates are standard FieldtypePage page reference fields. The admin interface is a Process module and the picker is a standard Inputfield. If you're comfortable with ProcessWire, you're already comfortable with how MediaHub works under the hood.
We think you'll like…
-
›
A clean chainable template API that works just like native ProcessWire.
$asset->image()->width(800)and every standard PW image method works identically, becauseimage()returns a realPageimage. -
›
Custom page classes for assets, crops, and collections, which means IDE autocompletion, type-hinting, and stable method names that won't break if internals change.
-
›
ensureCropImage()checks for an existing named crop, creates a centred one if none exists, saves the crop page, and returns the image. One line instead of twenty. -
›
resolvedCropImage()checks for a field-level crop first, falls back to the library crop automatically. Editors get per-page control where they need it; your template code stays simple. -
›
Per-reference metadata — the same asset can carry a different caption or description depending on which page it appears on, without duplicating the asset. Set a description override in the field on the page editor; the template falls back to the global alt text if none is set.
-
›
Usage tracking built in — every reference to an asset is tracked. Call
$asset->usages()to see where something is referenced before deciding whether to delete it. -
›
Querying with selectors — find assets by label, collection, MIME type, or any combination using standard PW selectors. No custom query language to learn.
-
›
A smart import tool — scan your existing page image fields and bring assets into the library using filename, dimensions, and perceptual hash matching. Run existing sites and MediaHub side by side during migration.
-
›
TinyMCE integration — the MediaHub picker is available inside rich text fields with rename-safe URL tracking, so embedded images don't break when an asset is renamed.
-
›
Staging and local installs are always free — site limits only apply to production. Work the way you normally would.
Tips for developers
Patterns that aren't always obvious from the docs but make a real difference once you know about them.
Use ensureCropImage() to generate crops lazily in templates
If a crop preset exists but no one has cropped the image yet, ensureCropImage('square') will create a centred crop automatically, save it as a crop page, and return the image. Ship templates that reference named crops without waiting for editors to crop every asset manually. If they've made a custom crop it uses that; if not, it falls back to a sensible default.
Use resolvedCropImage() as your default crop output method
cropImage() retrieves a crop from the library. resolvedCropImage() checks for a field-level crop first — one the editor has set specifically on that page and field — and falls back to the library crop if none exists. This gives editors per-page override control without you having to build anything extra.
Separate display tags from library labels
Library labels are for organisation — filtering the library, flagging review status, grouping by project. Display tags are per-reference and drive front-end output logic. A common pattern: label assets Stock photo or Client supplied in the library, and tag them hero or thumbnail per-page so your template can call $page->gallery->getTag('hero').
descriptionFor() auto-detects the field
Call $asset->descriptionFor($page) without specifying a field and MediaHub auto-detects the first MediaHub field on that page, returning the per-reference override and falling back to global alt text. Useful when iterating over assets without wanting to hard-code field names.
Query assets using standard ProcessWire selectors
Assets are pages, so you can query them directly. Want all images with a specific label? All PDFs in a particular collection? Standard PW selectors work exactly as you'd expect — combine collection filtering and label matching to build asset feeds, download lists, or media indexes without a custom database query.
Run MediaHub fields and native image fields side by side during migration
You don't have to migrate everything at once. Have a FieldtypeImage field and a MediaHub field on the same template, bring assets across page by page, and switch your template output over when you're ready. The perceptual hash matching finds likely duplicates even if filenames have changed.
Use the per-page import button as well as the global scan
The global scan is great for bulk importing. The per-page import button on the page editor scans other image fields on that specific page, matches against the library by filename, dimensions, and perceptual hash, and shows confidence badges so you can decide which ones to bring in. Useful for fine-grained control when working through a site page by page.
Full method reference: Template API docs and Crops API.
Also written for
Launch Pricing
Choose your plan
One-time licence — the software never expires. Includes 1 year of updates and support.
After year 1, optionally enable Auto Renew for continued releases and priority help.
Final checkout price may be adjusted by our payment provider based on your location. All prices exclude applicable tax/VAT.
For developers using MediaHub on a single production site with all components included.
- 1 production site
- All module components
- 1 year of updates
- 1 year of support
- Optionally renew for $29/yr
Save on the Solo plan by licensing up to 3 client sites in a single purchase.
- Up to 3 sites
- All module components
- 1 year of updates
- 1 year of support
- Optionally renew for $55/yr
Unlimited sites with priority support. Ideal for busy freelancers and small studios.
- Unlimited sites
- All module components
- 1 year of updates
- 1 year of support
- Optionally renew for $79/yr
Unlimited sites for teams and agencies with multiple developers.
- Unlimited sites
- All module components
- 1 year of updates
- 1 year of support
- Team seats
- Optionally renew for $129/yr