Search by

manuxi / sulu-testimonials-bundle

manuxi

A Sulu CMS bundle for managing customer testimonials, reviews, and quotes with configurable star ratings.

Package info

github.com/manuxi/SuluTestimonialsBundle

Type:symfony-bundle

pkg:composer/manuxi/sulu-testimonials-bundle

Statistics

Installs: 53

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

1.10.0 2026-11-14 01:56 UTC

README

php workflow symfony workflow License: MIT GitHub Tag Supports Sulu 3.0 or later

English | Deutsch

A Sulu CMS bundle for managing customer testimonials, reviews, and quotes with configurable star ratings.

Admin View

โœจ Features

  • Testimonial Management - Create, edit, and publish customer testimonials
  • Star Rating System - Configurable 5 or 10 point rating scale with star symbols
  • Contact Integration - Link testimonials to Sulu contacts
  • Smart Content Provider - Use testimonials in any Sulu page via Smart Content
  • Selection Content Types - Single and multiple testimonial selection
  • Workflow Support - Draft/Published workflow with versioning
  • Multi-language - Full translation support
  • SEO & Sitemap - Built-in SEO and sitemap integration
  • Search Integration - Admin and website search indexes
  • Trash Support - Restore deleted testimonials
  • Activity Logging - Track all changes

Breaking change

  • uuid - since 1.5.0 (not compatible to previous versions)

๐Ÿ“‹ Requirements

  • PHP 8.2+
  • Sulu CMS 3.0+
  • Symfony 6.4+ / 7.0+

๐Ÿ‘ฉ๐Ÿปโ€๐Ÿญ Installation

Step 1: Install via Composer

composer require manuxi/sulu-testimonials-bundle

Step 2: Register the Bundle

If not using Symfony Flex, add to config/bundles.php:

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

Step 3: Configure Routes

Add to config/routes/sulu_admin.yaml:

SuluTestimonialsBundle:
    resource: '@SuluTestimonialsBundle/Resources/config/routes_admin.yaml'

Step 4: Update Database

# Preview changes
php bin/console doctrine:schema:update --dump-sql

# Apply changes
php bin/console doctrine:schema:update --force

Step 5: Build Admin Assets

cd assets/admin
npm install
npm run build

Admin JavaScript compatibility

The bundle contains JavaScript registrations for its testimonial field types. Importing sulu-testimonials-bundle is optional and is not required for the server-side routes, controllers, or templates.

If SuluAdminExtrasBundle is installed, use its JavaScript registration for the star-rating fields and do not additionally import sulu-testimonials-bundle. Both bundles register the star_rating field under the same key; importing both makes the Sulu Admin stop after login with:

Error: The key "star_rating" has already been used for another field

Step 6: Grant Permissions

  1. Go to Settings โ†’ User Roles in Sulu Admin
  2. Select the appropriate role
  3. Enable permissions for Testimonials
  4. Save and reload

๐Ÿงถ Configuration

Create config/packages/sulu_testimonials.yaml:

sulu_testimonials:
    rating:
        max_value: 5            # 5 or 10 point scale
        default_value: 3        # Default rating for new testimonials
        use_star_symbols: true  # Show stars in admin dropdown
        use_star_widget: false  # Use interactive star widget (future)

See Configuration Documentation for all options.

๐ŸŽฃ Usage

Smart Content

Use testimonials in any page template:

<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>

Selection Types

Single testimonial:

<property name="featured_testimonial" type="single_testimonial_selection">
    <meta>
        <title lang="en">Featured Testimonial</title>
    </meta>
</property>

Multiple testimonials:

<property name="testimonials" type="testimonial_selection">
    <meta>
        <title lang="en">Testimonials</title>
    </meta>
</property>

Twig Template

{% for testimonial in testimonials %}
    <div class="testimonial">
        <blockquote>{{ testimonial.text|raw }}</blockquote>
        
        {% if testimonial.contact %}
            <cite>{{ testimonial.contact.fullName }}</cite>
        {% endif %}
        
        {# Rating display - uses global variable #}
        {% if testimonial.rating >= 0 %}
            {% set maxRating = testimonials_rating_max_value %}
            <div class="rating">
                {{ testimonial.rating }}/{{ maxRating }}
            </div>
        {% endif %}
    </div>
{% endfor %}

๐Ÿ“– Documentation

๐Ÿ”Œ Optional Integrations

Star Rating in Admin Lists

If you have SuluTweaksBundle installed, you can enable star rating display in admin lists. See Admin List Documentation.

Dashboard Tile

With SuluDashboardBundle the dashboard shows a Ratings tile: the number of published testimonials per star rating (highest first) and below it the number of unpublished ones, linking to the testimonial list. The tile is placed in the narrow column, follows the toolbar language and only appears for users with the "View" permission for testimonials. Without the dashboard bundle nothing is loaded or required (composer suggest).

Screenshot needed: dashboard with the "Ratings" tile (docs/img/dashboard-ratings.en.png).

๐Ÿ‘ฉโ€๐Ÿณ Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

๐Ÿ“„ License

This bundle is released under the MIT License.