Skip to content

manuxi/SuluTestimonialsBundle

Repository files navigation

SuluTestimonialsBundle!

php workflow symfony workflow License: MIT GitHub license

I made this bundle to have the possibility to manage testimonials in my projects.

This bundle contains

  • Several filters for Testimonials Content Type
  • Link Provider
  • Sitemap Provider
  • Handler for Trash Items
  • Handler for Automation
  • Possibility to assign a contact as author
  • Twig Extension for resolving Testimonials / get a list of Testimonials
  • Events for displaying Activities and more...

The testimonials 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-testimonials-bundle

If you're not using Symfony Flex, you'll also need to add the bundle in your config/bundles.php file:

return [
    //...
    Manuxi\SuluTestimonialsBundle\SuluTestimonialsBundle::class => ['all' => true],
];

Please add the following to your routes_admin.yaml:

SuluTestimonialsBundle:
    resource: '@SuluTestimonialsBundle/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_):
testimonials, testimonials_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 testimonials. After reload you should see the testimonials item in the navigation. Start to create testimonials. Use smart_content property type to show a list of testimonials, e.g.:

<property name="testimonials" type="smart_content">
    <meta>
        <title lang="en">Testimonials</title>
        <title lang="de">Testimonials</title>
    </meta>
    <params>
        <param name="provider" value="testimonials"/>
        <param name="max_per_page" value="5"/>
        <param name="page_parameter" value="page"/>
    </params>
</property>

Example of the corresponding twig template for the testimonials list:

{% for testimonial in testimonials %}
    <div class="col">
        <h2>
            {{ testimonial.contact.fullname }}
        </h2>
        <p>
            {{ testimonial.text|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 :).

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published