Annotations LocalGov Demo Recipe
Bolt-on demo recipe for LocalGov Drupal sites. Wires annotation targets and starter annotations onto existing LocalGov content types and paragraph types — no new content types or field storages are created.
What you get
Annotation targets
| Target | Bundle | Fields |
|---|---|---|
node__localgov_event |
Event | title, body, localgov_event_date, localgov_event_location, localgov_event_categories, localgov_event_image, localgov_event_price, localgov_event_call_to_action, localgov_event_locality |
node__localgov_subsites_page |
Subsite page | title, localgov_subsites_summary, localgov_subsites_parent, localgov_subsites_banner, localgov_subsites_topic, localgov_subsites_content |
paragraph__localgov_accordion |
Accordion | localgov_title, localgov_heading_level, localgov_paragraphs, localgov_display_show_hide_all, localgov_allow_multiple_open |
paragraph__localgov_banner_primary |
Banner primary | localgov_title, localgov_subsites_banner_text, localgov_image, localgov_url, localgov_subsites_banner_logo |
Annotation types: Editorial, Technical, Rules (from annotations_demo_types dependency)
Starter annotations: 44 — covering all fields across all four targets
Default role permissions: the recipe grants annotation permissions to LocalGov's own localgov_author and localgov_editor roles (shipped by the localgov install profile via localgov_roles, not by this recipe) so the demo is usable out of the box, without a manual permissions step:
| Permission | Author | Editor |
|---|---|---|
| View overlay (form + view) | Yes | Yes |
| Consume editorial / rules annotations | Yes | Yes |
| Consume technical annotations | No | Yes |
| Access site-wide annotation collection | No | Yes |
| Edit / delete annotations (all types) | No | Yes |
localgov_author is own-content-scoped (edit own / delete own on Event and Subsite page); localgov_editor has site-wide content access (edit any / delete any, plus taxonomy and workflow administration) — the same own-content-vs-site-wide distinction that sets the tier in the Umami demo recipe. As there, author is deliberately denied consume technical annotations: log in as an author and the ? overlay simply won't appear on fields carrying technical annotations, demonstrating that consume permissions gate visibility per annotation type rather than being all-or-nothing. administer annotations / administer annotation targets / administer annotation types (all restrict access: true) are never granted by this recipe — those stay admin-only.
LocalGov Drupal ships several other content roles (localgov_contributor, localgov_news_editor, localgov_admin, emergency_publisher) that this recipe deliberately leaves untouched — see CLAUDE.md for why.
Requirements
- Drupal 11 / PHP 8.3+
- LocalGov install (recommended: fresh, see the installation guide)
localgov_demoandannotations_overlayare installed automatically by this recipe;localgov_demobrings inlocalgov_eventsandlocalgov_subsiteswhich provide the targeted bundles
Installation
Install base LocalGov, per above. if you don't want to install the LGD demo, comment out the line "- localgov_demo" in the recipe - it should install over an existing site fine
drush cr
drush recipe modules/contrib/annotations/recipes/annotations_demo_lgd
drush cr
Where to look
After applying the recipe:
- Annotation targets: Admin → Config → Annotations → Targets
- Annotations UI: open any Event or Subsite page node for editing — field-level
?triggers appear on each annotated field (annotations_overlayis installed automatically by this recipe)
Teardown
Recipes are one-way. Delete the four annotation targets and the imported annotation entities to remove the demo data.
See also
- Root module README — full suite overview
- annotations_demo_types recipe — shared annotation types dependency
- annotations_demo recipe — standalone demo for fresh installs
- annotations_demo_umami recipe — Umami demo profile bolt-on
- annotations_demo_webform recipe — onboarding webform bolt-on