Widgets and blocks
Build dashboard widgets from a plugin, understand how page-builder blocks are stored and rendered, and sell website sections as marketplace widgets.
Уроки
Уроки для разработчиков написаны на английском: код, названия API и имена файлов везде на английском.
- Dashboard widgets from a pluginDeclare a widget in module.json, render plain data in register(), and let the dashboard draw, validate and sanitise it.около 8 мин
- Widget kinds, HTML sanitising and the dashboard filterThe four data kinds, tones and links, which HTML survives, and how the dashboard.widgets filter hides widgets per user.около 7 мин
- Page-builder blocksHow pages are stored as block JSON, which block types exist, and what adding a new block involves (a core change, not a plugin).около 9 мин
- Marketplace widgets: fields, template and CSSA widget.json is data: typed fields the owner fills, a logic-less always-escaped template and CSS that the platform scopes to the block. No widget code runs on the server.около 9 мин
- Widget scripts in a sealed frameA widget with a script renders inside a sandboxed iframe with its own policy: it reads the owner's values from window.WIDGET and has no network, cookies or access to the page.около 6 мин