manuxi / sulu-abbreviations-bundle
Say hello to Sulu abbreviations!
Package info
github.com/manuxi/SuluAbbreviationsBundle
Type:symfony-bundle
pkg:composer/manuxi/sulu-abbreviations-bundle
Requires
- php: ^8.2
- doctrine/doctrine-bundle: ^2.13
- massive/search-bundle: ^2.9
- sulu/content-bundle: ^0.8.3
- sulu/sulu: ^2.6
- symfony/config: ^6.4 | ^7.0
- symfony/console: ^6.4 | ^7.0
- symfony/dependency-injection: ^6.4 | ^7.0
- symfony/event-dispatcher: ^6.4 | ^7.0
- symfony/framework-bundle: ^6.4 | ^7.0
- symfony/http-foundation: ^6.4 | ^7.0
- symfony/http-kernel: ^6.4 | ^7.0
- symfony/intl: ^6.4 | ^7.0
- symfony/routing: ^6.4 | ^7.0
- symfony/security-core: ^6.4 | ^7.0
- symfony/translation: ^6.4 | ^7.0
- symfony/uid: ^6.4 | ^7.0
- symfony/workflow: ^6.4 | ^7.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.64
- handcraftedinthealps/zendsearch: ^2.0
- jackalope/jackalope-doctrine-dbal: ^1.3.4 | ^2.0
- phpspec/prophecy-phpunit: ^2.4
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^10.5
- sulu/automation-bundle: ^2.1
- symfony/browser-kit: ^6.4 | ^7.0
Suggests
- sulu/automation-bundle: Allows to schedule publishing and unpublishing of abbreviations
Provides
None
Conflicts
None
Replaces
None
- 2.x-dev
- 2.0.0
- 1.9.0
- 1.8.5
- 1.8.4
- 1.8.3
- 1.8.2
- 1.8.1
- 1.8.0
- 1.7.1
- 1.7.0
- 1.6.0
- 1.5.7
- 1.5.6
- 1.5.5
- 1.5.4
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.0
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.9
- 1.2.8
- 1.2.7
- 1.2.6
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.11
- 1.1.10
- 1.1.9
- 1.1.8
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.2
- 1.0.1
- 1.0.0
- dev-feature/milestone-b
- dev-claude/festive-euler-1pewwp
- dev-claude/inspiring-goodall-9cjonm
- dev-main
This package is auto-updated.
Last update: 2026-10-12 14:34:20 UTC
README
A Sulu bundle to manage abbreviations (glossary entries) in your projects. Version 2 is built on the sulu/content-bundle, the same concepts as in Sulu 3.
Features
- Translatable content with draft and live version per locale, publish / unpublish / remove draft, scheduled publishing with the automation bundle (publishing)
- Structure template (
name,url,explanation,description,image,link), SEO and excerpt tabs, author - Copy to locale and delete a single translation (translations)
- Versions of every publish with restore (versions)
- References: where an abbreviation is used and what it uses (references)
- HTTP cache tagging and purging (http cache)
- Teaser provider (teaser), link provider, sitemap provider, smart content provider (smart content)
- Field types
abbreviation_selection/single_abbreviation_selection(field types) - Twig functions and the optional filter
abbr(twig), settings (settings) - Preview, trash, activity log, search indexes (draft and live)
- Migration of the data of version 1.x (upgrade)
Please feel comfortable submitting feature requests. This bundle is still in development. Use at own risk ๐ค๐ป
๐ฉ๐ปโ๐ญ Installation
Install the package with:
composer require manuxi/sulu-abbreviations-bundle
If you're not using Symfony Flex, you'll also need to register the bundles in your config/bundles.php file.
The SuluContentBundle has to be registered before this bundle:
return [ //... Sulu\Bundle\ContentBundle\SuluContentBundle::class => ['all' => true], Manuxi\SuluAbbreviationsBundle\SuluAbbreviationsBundle::class => ['all' => true], ];
Please add the following to your routes_admin.yaml:
SuluAbbreviationsBundle: resource: '@SuluAbbreviationsBundle/Resources/config/routes_admin.yaml'
Add the index of the published abbreviations to your sulu_search.yaml. "abbreviations_published" is the index of the live content, "abbreviations" the index of the drafts. Both indexes are searchable in the admin.
sulu_search: website: indexes: - abbreviations_published - ...
Optionally install sulu/automation-bundle (scheduled publishing) and use the HTTP cache of Sulu (sulu_http_cache).
Last but not least the database schema needs to be updated. The tables abbr_abbreviations, abbr_abbreviation_dimension_contents, abbr_abbreviation_dimension_content_excerpt_tags, abbr_abbreviation_dimension_content_excerpt_categories, abbr_abbreviation_versions and app_abbreviation_settings are used. Create a Doctrine migration with
php bin/console doctrine:migrations:diff
or copy the migration template (MySQL / MariaDB). Without migrations use php bin/console doctrine:schema:update --dump-sql / --force. Make sure you only process the schema updates of this bundle!
Upgrading from 1.x? Read the upgrade guide.
๐ฃ Usage
First: Grant permissions for abbreviations (security context sulu.abbreviations.abbreviations, permissions view, add, edit, delete and live).
After reload you should see the abbreviations item in the navigation. Start to create abbreviations.
Use the smart_content property type to show a list of abbreviations:
<property name="abbreviations" type="smart_content"> <meta> <title lang="en">Abbreviations</title> </meta> <params> <param name="provider" value="abbreviations"/> <param name="max_per_page" value="5"/> <param name="page_parameter" value="page"/> </params> </property>
Use the field types abbreviation_selection (multiple) or single_abbreviation_selection (single) to select abbreviations in a template. Only abbreviations published in the current locale are returned, in the order of the selection.
{% for abbreviation in abbreviations %}
<h2>{{ abbreviation.name }}</h2>
<p>{{ abbreviation.explanation|raw }}</p>
{% endfor %}
The detail page of an abbreviation is rendered with the template @SuluAbbreviations/abbreviation.html.twig (variable content), override it with templates/bundles/SuluAbbreviationsBundle/abbreviation.html.twig.
Further templates of the type abbreviation can be added through sulu_core.content.structure.paths.
Twig functions
sulu_resolve_abbreviation(id, locale = null): returns the live content of the abbreviation if it is published in the given locale, otherwisenull.sulu_get_abbreviations(limit = 100, locale = null): returns the published abbreviations of the given locale.abbrfilter (optional): wraps the known abbreviations of a text in<abbr>.
๐งถ Configuration
sulu_abbreviations: versioning: max_versions: 20 # versions per abbreviation and locale, 0 disables versioning twig: auto_abbr: false # registers the twig filter "abbr"
The settings in the admin (Abbreviations > Settings) control the single view (header, default hero, breadcrumbs) and the intermediate page for the breadcrumbs.
See CHANGELOG.md for all changes.
๐ฉโ๐ณ Contributing
For the sake of simplicity this extension was kept small. Please feel comfortable submitting issues or pull requests. As always I'd be glad to get your feedback to improve the extension :).