Building Custom Extensions (assets/extensions/)
Standalone Qwiki's ExtensionManager automatically discovers self-contained plugins placed in assets/extensions/<extension-id>/βrequiring zero edits to core files.
Extension Types
Every extension folder contains a manifest.json declaring either "type": "page_type" or "type": "utility".
1. Page Type Extension (type: "page_type")
Adds a new document format alongside Markdown, PDF, and Google Docs (built-in examples: page-html, page-form):
{
"id": "diagram_board",
"type": "page_type",
"title": "Architecture Board",
"icon": "πΊοΈ",
"badge": { "label": "BOARD", "class": "badge-board" },
"file_extensions": [".board.json"],
"renderer": "renderer.php",
"modal": "modal.html.php",
"handler": "handler.php",
"search_extractor": "search_extractor.php",
"actions": ["create_board", "save_board"],
"styles": ["style.css"],
"scripts": ["script.js"]
}
2. Utility Extension (type: "utility")
Adds workspace tools, collaboration widgets, or admin dashboards (built-in examples: tool-revisions, tool-talk, tool-comments, tool-activity-log, tool-postbox):
{
"id": "custom_audit",
"type": "utility",
"adminOnly": true,
"title": "Custom Audit",
"icon": "π",
"placement": "header_menu",
"modal": "modal.html.php",
"handler": "handler.php",
"actions": ["ext_custom_audit_run"],
"styles": ["style.css"],
"scripts": ["script.js"]
}
Key Contract Fields
| Field | Purpose |
|---|---|
id |
Unique extension key stored under config['extensions'][id] (default enabled unless toggled off in Settings β Extensions). |
placement (utilities) |
Controls UI injection: header_menu (dropdown under user menu), document_toolbar (next to Share/Edit), content_tabs (above document body, e.g. Talk Pages), or content_footer (below document body, e.g. Comments). |
adminOnly |
Restricts utility trigger rendering and default access to administrators. |
renderer / modal / handler |
PHP files relative to the extension directory; api/admin.php delegates declared actions directly to handler.php. |
search_extractor |
Optional PHP extractor returning plain text from custom file formats so api/search.php indexes your extension's documents. |
styles / scripts |
Local relative paths or external CDN URLs; automatically omitted from HTML output when the extension is disabled for a wiki. |