mediaplace-dev

Guides development of the MediaPlace REDAXO media pool overlay addon.

4|Updated Aug 26, 2026
One-click install
npx skills add https://github.com/FriendsOfREDAXO/mediaplace --skill mediaplace-dev-friendsofredaxo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mediaplace-dev
Source: https://github.com/FriendsOfREDAXO/mediaplace/tree/main/.claude/skills/mediaplace-dev
Command: npx skills add https://github.com/FriendsOfREDAXO/mediaplace --skill mediaplace-dev-friendsofredaxo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developing the MediaPlace REDAXO addon requires navigating a complex architecture: an esbuild-bundled overlay core, hand-edited widget assets, custom REST API endpoints, permission checks, and subtle pitfalls like opcache staleness, unpublished API functions, and lazy-loaded Metainfo extension points. This Skill encodes all of that institutional knowledge so changes are made correctly the first time. ## Core Features & Use Cases - Architecture guidance: Documents the five independently toggleable parts (Overlay, Input-Widget, classic integration, Metainfo canvas, YForm value type) and where each piece of code lives. - Critical-area checklists: Thirteen documented pitfalls covering API-addon version checks, permission enforcement, CSS dark-mode variable blocks, chunked bulk-action contracts, language file parity, and CLI boot limitations. - Verification discipline: Prescribed workflows for JS syntax checks, CSS variable audits, PHP linting, esbuild rebuilds, asset syncing, and live verification via curl and system logs. - Use Case: When adding a new REST endpoint to the addon, the Skill reminds you to register it in boot.php, set $published = true, add MediaPermission checks, and verify via curl rather than trusting a generic JS fetch error. ## Quick Start Use the mediaplace-dev skill to add a new filter option to the MediaPlace overlay grid and rebuild the bundle correctly.

Frequently Asked Questions about mediaplace-dev

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new REST API endpoint to a REDAXO addon?

Create a rex_api_function subclass in lib/Api/, register it explicitly in boot.php, and set protected $published = true if it is called via fetch from pages that may not run under the backend entry point. Always enforce MediaPermission checks inside execute() since rex::getUser() only verifies login.

How do I build the MediaPlace overlay JavaScript bundle?

Edit sources in src/mediaplace/core.js and src/mediaplace/modules/*.js, then run npm run build to bundle with esbuild into assets/mediaplace.js, followed by assets:sync. Never edit assets/mediaplace.js directly because it is generated and overwritten on every build.

Why does my REDAXO rex_api_function return 'not published' errors?

rex_api_function::$published defaults to false, so the call only works when rex::isBackend() is true for the actual PHP entry point. Relative URLs from rex_url::backendController() can resolve to the frontend entry point, so set $published = true and enforce permissions inside execute().

Does the MediaPlace widget require a build step?

No, only the overlay core (src/mediaplace/) uses esbuild. The widget (mediaplace_widget.js), classic integration, shared helpers, and CSS files are hand-edited assets that only need assets:sync after changes, with no build step.

Why do PHP changes not appear immediately in REDAXO?

If opcache.validate_timestamps is enabled with a revalidate_freq above zero, PHP edits can appear stale. Reload the web server or PHP-FPM process, or reset the opcache, instead of doubting the code change itself.

How do I register a YForm media field as 'in use' in REDAXO?

YForm auto-discovers value types by class naming convention, but the media-in-use check is separate. Register rex_extension::register('MEDIA_IS_IN_USE', ...) in boot.php for your value type, otherwise REDAXO will report referenced files as unused and deletable.