manuxi / sulu-glossary-bundle
Glossary bundle for Sulu CMS: abbreviations, acronyms and terms with draft/live publishing
Package info
github.com/manuxi/SuluGlossaryBundle
Type:symfony-bundle
pkg:composer/manuxi/sulu-glossary-bundle
Requires
- php: ^8.2
- doctrine/doctrine-bundle: ^2.13
- sulu/sulu: ^3.0
- 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
Requires (Dev)
- cmsig/seal-memory-adapter: ^0.12
- friendsofphp/php-cs-fixer: ^3.64
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^10.5 | ^11.0
- sulu/automation-bundle: ^3.0
- symfony/browser-kit: ^6.4 | ^7.0
- symfony/phpunit-bridge: ^6.4 | ^7.0
Suggests
- manuxi/sulu-admin-extras-bundle: Provides additional admin components such as the ghost locale and publish state field types
- sulu/automation-bundle: Allows to schedule publishing and unpublishing of glossary entries
Provides
None
Conflicts
None
Replaces
None
README
The SuluGlossaryBundle extends Sulu 3.0 with a glossary for abbreviations, acronyms and terms.
Every entry has a type, an explanation, an optional description, image and link, and its own detail page. Entries use the content features of Sulu: draft and live content per locale, versions, SEO and excerpt data, search, references and scheduled publishing.
This bundle is the successor of manuxi/sulu-abbreviations-bundle (Sulu 2). The data of the 2.0 release can be migrated with a command, see UPGRADE.md.
โจ Features
๐ Glossary Management
- Entry Types - Abbreviation, acronym or term
- Rich Content - Title, explanation, description, image and link
- Draft & Live - Separate draft and live content per locale, publish and unpublish
- Versions - Restore older versions into the draft
- SEO & Excerpt - Full SEO and excerpt management
- Multilingual - Full translation support, copy to locale
- Author Management - Assign contacts as authors
- Settings - Header, hero, breadcrumbs and overview page
- More - Trash, references, sitemaps, teaser, preview, activity log, etc.
๐ Advanced Features
- Selection Field Types - Select one or multiple entries in pages, snippets and other templates
- Smart Content - List entries filtered by categories and tags
- Twig Functions - Resolve entries in templates, optional
abbrfilter for automatic markup - Search - Admin and website index (SEAL)
- HTTP Cache - Tagging and automatic invalidation
- Scheduled Publishing - Publish and unpublish at a given date (
sulu/automation-bundle) - Migration - Command to migrate the data of SuluAbbreviationsBundle 2.0
๐ Prerequisites
- PHP 8.2 or higher
- Sulu CMS 3.0 or higher
- Symfony 6.4 or higher
- MySQL 5.7+ / MariaDB 10.2+ / PostgreSQL 11+
๐ฉ๐ปโ๐ญ Installation
Step 1: Install the package
composer require manuxi/sulu-glossary-bundle
If you are not using Symfony Flex, add the bundle to config/bundles.php:
return [ //... Manuxi\SuluGlossaryBundle\SuluGlossaryBundle::class => ['all' => true], ];
Step 2: Configure routes
Add to routes_admin.yaml:
SuluGlossaryBundle: resource: '@SuluGlossaryBundle/Resources/config/routes_admin.yaml'
Step 3: Update the database
# Check what will be created php bin/console doctrine:schema:update --dump-sql # Execute migration php bin/console doctrine:schema:update --force
With Doctrine migrations use doctrine:migrations:diff. A MySQL migration template is available in docs/templates/doctrine-migration.php.dist.
Step 4: Rebuild the search index
php bin/console sulu:search:reindex
Step 5: Grant permissions
- Go to Sulu Admin โ Settings โ User Roles
- Find the appropriate role
- Enable the permissions for the glossary entries (
sulu.glossary.entries) and the glossary settings (sulu.glossary.settings) - Reload the page
๐ฃ Usage
Create your first entry
- Navigate to Glossary in the Sulu admin navigation
- Click on Add
- Choose the type, enter title and explanation
- Add description, image and link (optional)
- Publish your entry
Use entries in templates
<property name="entries" type="glossary_entry_selection"> <meta> <title lang="en">Glossary entries</title> </meta> </property>
{% set entry = sulu_resolve_glossary_entry(id) %}
{% if entry %}
<abbr title="{{ entry.explanation }}">{{ entry.title }}</abbr>
{% endif %}
More examples: Selection field types, Smart content, Twig.
๐งถ Configuration
# config/packages/sulu_glossary.yaml sulu_glossary: versioning: max_versions: 20 # versions per entry and locale, 0 = unlimited twig: auto_abbr: false # enables the abbr twig filter
Further options: Settings
๐ Documentation
Detailed documentation in the docs/ directory.
- Types - Abbreviation, acronym, term
- Publishing - Draft, live and the activity log
- Translations - Copy to locale, delete a translation
- Versions - Versions and restore
- Selection field types - Select entries in templates
- Smart content - Filtering by categories and tags on the website
- Teaser - Teaser provider
- Twig - Functions,
abbrfilter and default view - Links, sitemap & preview - Links, sitemap, preview and trash
- Search - Admin and website index
- References - Where entries are used
- HTTP cache - Tagging and invalidation
- Automation - Scheduled publishing
- Settings - Header, hero, breadcrumbs, overview page
- Upgrade from SuluAbbreviationsBundle - Migration of the data
๐ฉโ๐ณ Contributing
Contributions are welcome! Please create issues or pull requests.
๐ License
This bundle is licensed under the MIT License. See LICENSE.
๐ Credits
Created and maintained by manuxi.
Thanks to the Sulu team for the great CMS and fantastic support!
And thank you for your support and testing!