components.json, or pass ?page_id=N in the URL to auto-load.
components.json, or pass ?page_id=N in the URL to auto-load.
MARCOMM - ). Must be unique.
_isNew: true so your server inserts it.
If your portal requires login, the browser needs a way to send your session with API calls. Pick the option that fits how you host this editor:
Save this file inside your Yii2 app (e.g. /web/admin/editor.html)
so the URL is something like:
https://brs.dynaweb4.work/admin/editor.html
Log into the portal in the same browser first, then open the editor.
The session cookie is automatically sent with every fetch call
because it's same-origin. No extra config needed.
Put this in the Custom Headers field:
Authorization: Bearer YOUR_TOKEN_HERE
Works cross-origin (including file://)
as long as your API's CORS settings allow the Authorization header.
Log into the portal in your browser, open DevTools → Application → Cookies, copy the session cookie
(e.g. PHPSESSID),
then add to Custom Headers:
Cookie: PHPSESSID=abc123xyz...
Most browsers forbid scripts from setting the Cookie header for security, so this usually fails unless the editor is served from the same domain. If it doesn't work, use Option A or D instead.
If your portal's API is served behind a login and you can't configure the above:
components.jsonFor cross-origin API calls with credentials, your Yii2 response must include:
Access-Control-Allow-Origin: <exact editor origin, not *> Access-Control-Allow-Credentials: true Access-Control-Allow-Headers: Content-Type, Authorization Access-Control-Allow-Methods: GET, POST, OPTIONS