HFCM-style manager for sitewide HTML, CSS, and JavaScript snippets on Grav 2 Admin Next. Insert into the public site and/or the admin SPA without editing theme files.
- Grav 2.0+
- API plugin (Admin Next)
- Admin2 plugin
- PHP 8.3+
- Copy or install the plugin to
user/plugins/intention-header-footer-code. - Enable in Admin2 Plugins or set
user/config/plugins/intention-header-footer-code.yaml:
enabled: true- Clear cache:
bin/grav cache
- Open Admin Next → Header Footer Code in the sidebar.
- Add a snippet: title, type (HTML / CSS / JS), location (header / footer), target (frontend / backend / both).
- For JavaScript, optionally enable Defer and/or Async.
- Toggle enable/disable from the list without opening the editor.
Snippets are stored in user/data/intention-header-footer-code/snippets.yaml.
| Permission | Purpose |
|---|---|
admin.intention-header-footer-code.read |
List/view snippets |
admin.intention-header-footer-code.write |
Create/update/delete |
Super admins (api.super) can manage everything.
This directory is a product-scoped Cursor workspace. See AGENTS.md and .cursor/.