A photo gallery field plugin for Emdash CMS. Adds a gallery-uploader field widget to the content editor that lets editors upload multiple photos, reorder them, and add captions and alt text — all stored as a JSON array on the content entry.
- Adds a Gallery Images field widget to the Emdash admin content editor
- Editors can upload new photos directly from their computer (uploaded to your R2 media library)
- Editors can choose existing photos from the Emdash media library (multi-select)
- Drag-to-reorder, per-photo captions, and alt text
- Includes a Photo Gallery Manager admin page showing image counts across all posts and pages
pnpm add ebt-plugin-gallery-images// astro.config.mjs
import { defineConfig } from "astro/config";
import emdash from "emdash";
import { galleryImagesPlugin } from "ebt-plugin-gallery-images";
export default defineConfig({
integrations: [
emdash({
plugins: [galleryImagesPlugin()],
}),
],
});In your seed file or Content Type Builder, add a json field and set the widget to gallery-uploader:
{
"name": "images",
"label": "Gallery Images",
"type": "json",
"options": {
"widget": "gallery-uploader"
}
}The field stores a JSON array of objects:
interface GalleryImage {
mediaId: string; // R2 storage key
caption: string;
alt: string;
}---
const images = entry.data.images ?? [];
---
{images.map((img) => (
<figure>
<img
src={`/cdn-cgi/image/width=1200,format=webp/_emdash/api/media/file/${img.mediaId}`}
alt={img.alt}
/>
{img.caption && <figcaption>{img.caption}</figcaption>}
</figure>
))}- Emdash
^0.16.0 - Cloudflare R2 media storage (the plugin uploads via
POST /_emdash/api/media— presigned URL upload is not used)
Photo gallery field plugin for EmDash CMS. Designed by Marcus Shaw for Every Bit Texas. Coded by Claude Code.
Built for EmDash CMS — star the repo to support open-source CMS development.
MIT