Search by

stijnhau / help-bundle

stijnhau

Admin-editable help pages and FAQs for Symfony apps: ordered sections with anchors, icons and translations, admin-only editing (via stijnhau/moderation-bundle) and optional ready-made pages.

Package info

github.com/stijnhau/help-bundle

Type:symfony-bundle

pkg:composer/stijnhau/help-bundle

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-11-28 22:07 UTC

This package is auto-updated.

Last update: 2026-11-28 22:21:19 UTC


README

Admin-editable help pages and FAQs for Symfony apps, shared by CityWars, Crime-Life and F1Manager. A page is ordered sections, each with an anchor (/help#getting-started), an icon, a title and a rich-text body, plus optional translations. A section can be an FAQ, where each <h3> is a question. It builds on stijnhau/moderation-bundle: only its admins may edit, and every change goes in its audit log.

Piece What it does
Model\AbstractHelpSection Doctrine mapped superclass: slug (unique), icon, position, FAQ flag, title, body, translations, updated time.
Service\HelpAdmin create(), update() (from a HelpSectionData), move(), delete(): admins only, with every rule. Bodies are sanitized HTML.
Query\HelpReader Sections in order, by id or anchor; faqItems() splits an FAQ body into questions and answers.
Twig UI (optional) /help and an admin (list, write, edit, reorder, delete) with ui.enabled: true.

Install

composer require stijnhau/help-bundle

Register and configure stijnhau/moderation-bundle first, then:

#[ORM\Entity]
class HelpSection extends AbstractHelpSection {}
stijnhau_help:
    section_class: App\Entity\HelpSection
    body_max_length: 50000
    sanitizer: ~             # an HtmlSanitizerInterface service id
    locales: [fr, nl]
    audit_log: true
    actions: { created: help.created, updated: help.updated, moved: help.moved, deleted: help.deleted }
    ui:
        enabled: false
        admin_role: ROLE_ADMIN

Then run bin/console make:migration. With the UI enabled, import @StijnhauHelpBundle/config/routes.php (prefix /help) and routes_admin.php (prefix /admin/help), both with trailing_slash_on_root: false.

To use your own layout, override templates/bundles/StijnhauHelpBundle/help/layout.html.twig (keep the help_title and help blocks) and admin/layout.html.twig (keep help_title and help_admin). Body fields carry data-help-editor.

Errors are HelpExceptions, with keys in the stijnhau_help domain (en/nl/fr included). A HelpChangedEvent is dispatched for every change.

License

MIT, see LICENSE.