goldnead/statamic-toc
goldnead/statamic-toc is a Statamic addon that automatically generates a table of contents from your content headings, adds anchor links, and renders a configurable navigation list. It makes long articles and documentation easier to scan and navigate, with flexible options for heading levels and out...
Scope of change (v2.3.0). This release adds a Control Panel surface (Settings → Addon Settings) for the five {{ toc }} tag defaults — field, first level, number of levels, last level, flat list — previously only settable in config/statamic-toc.php. Per-tag arguments continue to override the stored defaults. There is no new required dependency.
goldnead/statamic-brand-context (brand-scoped settings + CP registration) and exposes a single new permission, manage toc settings. This is the right call: it keeps the addon's own surface small and reuses the host's existing settings/permission plumbing instead of introducing a second, divergent configuration path. The feature is strictly additive — config-file users are unaffected, and the tag contract is unchanged.statamic-brand-context ≥ 1.13 is installed; otherwise "nothing registers, and everything stays as it was." Enablement is one composer require plus a role assignment. The friction is concentrated in the permission step: nobody holds manage toc settings initially, so the section is invisible until an admin grants it. That is a correct-by-default security posture but a predictable first-run support ticket.config/statamic-toc.php → package default? Confirm the config file remains a viable override for teams that want config-as-code, and whether a CP save shadows it permanently.{{ toc }} invocation), and is it cached?Assessment: technically sound, additive, low-risk. The risk is concentrated in the dependency version floor and in settings provenance, not in the addon's own code.
Stack fit. Laravel/Composer-based Statamic site, goldnead/statamic-toc on Statamic 5 or 6. The only new moving part is an optional neighbour package, which matters only if you want the CP screen.
Decision fork — pick one deliberately:
| Path | When to choose | Work required |
|---|---|---|
| A. Config-file only (no change) | Statamic 5 sites; teams with config-as-code deploys; sites with no editor-facing tuning need | None. Upgrade the addon; behaviour is unchanged. |
| B. CP settings enabled | Statamic 6 sites where non-developers (editors/marketers) need to tune TOC defaults without a deploy | composer require goldnead/statamic-brand-context:^1.13, role assignment, docs/screenshots |
Migration path.
goldnead/statamic-toc to v2.3.0. No config changes, no data migration, no tag changes — safe to ship independently of any decision about the CP screen.goldnead/statamic-brand-context at ^1.13 (explicitly not ^1.0) so Composer cannot resolve to a version with the silent-override-deletion and single-brand write defects.manage toc settings to the appropriate role(s) — typically an admin or a dedicated "site settings" role, not editors by default.Compatibility. Statamic 5 = supported, CP screen unavailable (document this explicitly so it isn't reported as a bug). Statamic 6 + brand-context ≥1.13 = full feature. Statamic 6 without brand-context = supported, CP screen absent by design. No PHP/Laravel version constraints are stated in the notes — confirm against the package's composer.json before pinning.
Sequencing. (1) Addon upgrade alone → validate TOC output on a representative page, including per-tag overrides. (2) Optional brand-context install on staging → confirm the section appears only after permission grant, and that saving does not disturb existing config-file values in ways you don't expect. (3) Confirm precedence by setting a CP value, a config value, and a per-tag argument on the same page and checking which wins. (4) Promote to production, then have the content owner re-verify any previously stored values.
Maintenance. Low steady-state cost. One additional optional dependency to track, and a version floor (≥1.13) that should be encoded as a Composer constraint rather than a README note so it survives future composer update runs. The addon's dual Statamic 5/6 support means the maintainers carry a wider matrix, which is a (mild) signal about their test coverage — worth noting at renewal/review time.
Support surface. Three predictable ticket classes, all preventable with documentation:
Scaling. Effectively neutral for the primary use case. The change concerns defaults resolution at render time, not TOC generation, so no meaningful change to page-render cost is expected — but confirm whether default resolution is cached per request, since high-traffic templates rendering many {{ toc }} tags could otherwise add repeated config/brand lookups. Organisational scaling is the real consideration: enabling CP settings shifts control of TOC behaviour from developers to editors, which is the intended benefit but also means TOC structure can change without a code review or deploy. Decide deliberately whether that is acceptable for your governance model; if not, stay on Path A.
Failure modes and mitigations.
manage toc settings to exactly one role and record it; a permissive default elsewhere in your permission scheme could widen access unexpectedly.Ramp-up. Small and asymmetric. Editors need minutes: five clearly labelled fields with per-tag overrides still available, and the safest framing is "these are site-wide defaults; leave them alone unless you have a reason." Developers and site admins need perhaps an hour: understand the precedence chain, the Statamic 5/6 split, the 1.13 floor, and where the values physically live. No training is required for Path A adopters — their behaviour is unchanged.
Recommendation. Adopt v2.3.0. It is additive, has no breaking changes, no deprecations, and no new required dependencies. The upgrade is safe for all current users independently of any decision about the settings screen. Treat the CP screen as a separate, deliberate opt-in gated on Statamic 6, statamic-brand-context ^1.13, and an explicit permission grant — and close the precedence and persistence questions above before exposing it to non-technical editors.
How can I help you explore Laravel packages today?