AddStuff icon
Module Id
addstuff
Group Id
org.jahia.modules
Updated
Requires Jahia
8.2.0.0
Author
pvollenweider
Category
Tools and Utilities
Status
COMMUNITY info

AddStuff group_work

javascript styles html template

AddStuff lets you insert arbitrary HTML (scripts, stylesheets, etc.) at four precise locations in every rendered page. It works as a render filter: no template change, no redeployment, no developer required.

Dependencies & Dependants

Dependencies
  • NONE
Dependants
  • NONE

Changelog 3.0.3

Bug fixes

  • Fix CodeMirror blank display in Content Editor — when `jmix:addStuff` is applied to a page and the "Options" tab is opened in the Content Editor, the CodeMirror fields now render immediately without requiring a click. The editor was measuring 0px while the tab was hidden; a `ResizeObserver` now triggers `cm.refresh()` as soon as the tab becomes visible.

Improvements

  • Site settings panel fully migrated to React/Moonstone — removed Spring Webflow (`flow.xml`, `addStuffSettings.jsp`, `AddStuffSiteSettingsFlowHandler`). The settings panel now uses Moonstone `Button`, `Typography`, and `Loader` components, with inline save feedback replacing the custom toast. `mvn clean install` now compiles JavaScript automatically via the `frontend-maven-plugin`.

Tests

  • UI smoke tests for the settings panel — new Cypress spec verifying the React component mounts correctly (4 CodeMirror editors, Save/Cancel buttons), that values set via the CodeMirror API are saved and appear on the live page, and that Cancel reverts the editor to the last saved value.
  • Home page injection test — new spec verifying that `jmix:addStuff` works when applied directly to a `jnt:page` node (the home page), confirming the mixin is correctly scoped and does not bleed into sub-pages.

Full changelog: addstuff-3.0.2...addstuff-3.0.3

FAQ

My injected code does not appear on the page. 
AddStuff only injects code in preview and live modes. Switch out of edit mode and verify in preview first.

The Add Stuff panel is not visible in site administration. 
You don't have the siteAdminAddStuff permission. Ask your server administrator to assign you the Site Administrator role or a custom role that includes this permission.

I saved site-wide code but the live site still shows the old version. 
Site-level changes are auto-published — no workflow is needed. If the content still looks outdated, your CDN or reverse proxy may be serving a cached response. Purge the cache for the affected pages or wait for the TTL to expire.

I saved a page-level snippet but nothing changed in live. 
Page-level changes go through the standard Jahia publication workflow. Make sure the page has been published after saving.

Can I use AddStuff on multiple sites independently? 
Yes. Each site has its own independent AddStuff configuration. Settings on one site have no effect on any other.

Is the injected code validated or sanitized? 
No. Code is injected exactly as entered. Grant the siteAdminAddStuff permission only to trusted users — a malicious or erroneous script entered at site level would affect every visitor of every page.

How To Install

How to install

Requirements: Jahia 8.2 or higher.

  1. Log in to your Jahia server as a server administrator.
  2. Go to Server Administration → Modules & Extensions → Jahia Store.
  3. Search for AddStuff, click Install, then Deploy.

Alternatively, follow the module installation tutorial on the Jahia Academy.

Once deployed, the module need to be per-site activation required.


How to use

AddStuff lets you inject custom HTML at four locations in every rendered page:

Location Injected
Start of <head> Right after <head>
End of <head> Right before </head>
Start of <body> Right after <body>
End of <body> Right before </body>

 

Injected code is visible in preview and live modes only — nothing appears in edit mode.

When both site-level and page-level snippets are configured for the same location, site-level content is injected first, followed by page-level content.

Inject code on all pages — site administrators

  1. In jContent, navigate to Administration → Sites → [your site] → Add Stuff.
  2. Fill in the relevant code editors — one per injection point — with syntax highlighting.
  3. Click Save. Changes apply immediately, no publication workflow needed.

Required permission: siteAdminAddStuff, included in the built-in Site Administrator role. To grant access without full Site Administrator rights, create a custom site role with the Site admin add stuff permission under Server Administration → Roles and Permissions.

Inject code on a single page — editors

  1. Open the page in jContent edit mode.
  2. Open the page properties and go to the Options tab.
  3. Enable the toggle Add stuff in your HTML code (only for preview/live mode).
  4. Fill in the relevant fields and click Save.
  5. Publish the page for the changes to appear in live mode.

See full documentation at https://github.com/jahia/addStuff

Images

License

MIT License