Skip to content

v4.3.2 - Per-site embed code

Choose a tag to compare

@tallcms tallcms released this 25 Apr 13:57
· 42 commits to main since this release

Per-site embed code

Embed code (analytics, tracking pixels, chat widgets, custom <head>/body scripts) now scopes per site instead of being installation-wide. The standalone /admin/code-injection page is gone — it lives as an Embed Code tab on the Site edit page (Sites → {site} → Edit → Embed Code).

Why

The previous flow had ambient session-based site resolution that could write to the global tallcms_site_settings table even when the UI implied a specific site was selected. v4.3.2 eliminates that: saves go through SiteSettingsService::setForSite() with the explicit site_id from the edited record. Per-site values write to tallcms_site_setting_overrides and never bleed across sites.

What changed

  • New "Embed Code" tab in the Site edit form: head, body start, body end zones.
  • code_head, code_body_start, code_body_end removed from SiteSetting::$globalOnlyKeys — they now follow the standard per-site override pattern with global fallback.
  • Authorization for embed code follows Site edit permission via SitePolicy. The dedicated Manage:CodeInjection permission is gone from runtime references; the migration that created it is now a no-op for fresh installs.
  • The standalone /admin/code-injection page and its blade view were removed.

Backwards compatibility

  • TallCmsPlugin::make()->withoutCodeInjection() is kept as a deprecated no-op shim so existing panel providers don't fatal on upgrade.
  • Existing global rows in tallcms_site_settings (code_head, etc.) from prior versions are no longer read by the frontend — each site needs its own override now. After upgrading, copy the previous global value into each site that should keep it.
  • Upgraded installs may still have an orphan Manage:CodeInjection permission row in their DB; it's harmless and can be deleted by hand.

Plugin compatibility

The TallCMS Multisite plugin v2.2.0 wires the new embedCodeTab into its own Site edit form. Multisite installs should bump the plugin to v2.2.0 alongside this release.

Docs

Full changelog

See packages/tallcms/cms/CHANGELOG.md.