manuxi / sulu-abbreviations-bundle
Say hello to Sulu abbreviations!
Installs: 49
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^8.1
- doctrine/doctrine-bundle: ^2.12
- phpcr/phpcr-migrations-bundle: ^1.6
- sulu/sulu: ^2.5
- symfony/config: ^6.2 | ^7.0
- symfony/dependency-injection: ^6.2 | ^7.0
- symfony/framework-bundle: ^6.2 | ^7.0
- symfony/http-foundation: ^6.2 | ^7.0
- symfony/http-kernel: ^6.2 | ^7.0
- symfony/intl: ^6.2 | ^7.0
- symfony/security-core: ^6.2 | ^7.0
- symfony/translation: ^6.2 | ^7.0
Requires (Dev)
- jackalope/jackalope-doctrine-dbal: ^1.3.4
- phpspec/prophecy: ^1.17
- phpunit/phpunit: ^8.0
- symfony/browser-kit: ^6.0
- symfony/console: ^6.0
- symfony/phpunit-bridge: ^6.0
README
I made this bundle to have the possibility to manage abbreviations in my projects.
This bundle contains
- Several filters for Abbreviations Content Type
- Link Provider
- Sitemap Provider
- Handler for Trash Items
- Handler for Automation
- Possibility to assign a contact as author
- Twig Extension for resolving Abbreviations / get a list of Abbreviations
- Events for displaying Activities and more...
The abbreviations are translatable.
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 add the bundle in your config/bundles.php
file:
return [ //... Manuxi\SuluAbbreviationsBundle\SuluAbbreviationsBundle::class => ['all' => true], ];
Please add the following to your routes_admin.yaml
:
SuluAbbreviationsBundle: resource: '@SuluAbbreviationsBundle/Resources/config/routes_admin.yml'
Last but not least the schema of the database needs to be updated.
Some tables will be created (prefixed with app_):
abbreviations, abbreviations_translation.
See the needed queries with
php bin/console doctrine:schema:update --dump-sql
Update the schema by executing
php bin/console doctrine:schema:update --force
Make sure you only process the bundles schema updates!
๐ฃ Usage
First: Grant permissions for abbreviations. After reload you should see the abbreviations item in the navigation. Start to create abbreviations. Use smart_content property type to show a list of abbreviations, e.g.:
<property name="abbreviations" type="smart_content"> <meta> <title lang="en">Abbreviations</title> <title lang="de">Abbreviations</title> </meta> <params> <param name="provider" value="abbreviations"/> <param name="max_per_page" value="5"/> <param name="page_parameter" value="page"/> </params> </property>
Example of the corresponding twig template for the abbreviations list:
{% for abbreviation in abbreviations %} <div class="col"> <h2> {{ abbreviation.name }} </h2> <p> {{ abbreviation.explanation|raw }} </p> </div> {% endfor %}
๐งถ Configuration
There exists no configuration.
๐ฉโ๐ณ 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 :).