Discuss your project
Partitech Sonata Extra Bundle

Sonata Extra Bundle: features

Declare an administration with the PHP attribute #[AsAdmin] Place the admin service declaration directly on its class. Documentation: as-admin-attribute.md Code overview: Activity log in the administration The activity log feature in the Sonata Extra Bu...

Contrôles de compatibilité Symfony et Sonata

Declare an administration with the PHP attribute #[AsAdmin]

  • Place the admin service declaration directly on its class.
  • Documentation: as-admin-attribute.md
  • Code overview: AsAnAdmin.png

Activity log in the administration

The activity log feature in the Sonata Extra Bundle is designed to monitor and record all activities on the administration site. It provides a comprehensive view of the actions taken, the resources involved, descriptions of the activities, and the users who performed them.

  • Display of the action type: Displays the type of action performed (for example, create, update, delete).

  • Resource tracking: Identify the resource that was affected by the action.

  • Action Description: Provides a detailed description of the activity.

  • User Identification: Displays the user who performed the action.

  • Detailed view: Provides an in-depth view of the elements changed in each activity.

  • Undo Feature: Includes a function that allows changes to be reversed when possible.

  • List view:

Activity_log_index.png

  • Detailed view:

Activity_journal_detail.png

Activity Approval

The SonataExtra approval workflow is designed to record all actions within the admin site, providing a comprehensive overview of activities, involved resources, descriptions, and users. This feature ensures that actions are recorded but not applied immediately. Instead, they require validation by a user with ROLE_APPROVE permission.

  • Action Logging: Records each action but does not apply the changes immediately.

  • Role-based approval: Actions require the approval of a user with ROLE_APPROVE.

  • Pending Changes Alert: A red notification badge in the administration interface alerts administrators of changes awaiting approval.

  • Detailed action view: Displays the action type, the resource, the description, the user, and the date in the list view.

  • Approval and Detail Buttons: Allows administrators to approve changes or view detailed information.

  • Purge feature: An option to purge pending changes.

  • Detailed view of changes: Displays the fields and values affected for each action.

  • Documentation: approval-workflow.md

  • Publisher's action: publisher_action_approval.png

  • Administrator Notification: notification_approval_admin.png

  • List view: admin_approval_list.png

  • Detailed view: detail_admin_approval.png

Management of CSS and JavaScript resources

The bundle provides a flexible way to manage CSS and JavaScript resources in Sonata blocks. This feature allows developers to easily and efficiently include external CSS and JS files, as well as inline styles and scripts.

{{ sonata_extra_get_blocks_css('default')|raw }}
{{ sonata_extra_get_blocks_css_inline('default', true)|raw }}
{{ sonata_extra_get_blocks_js('default')|raw }}
{{ sonata_extra_get_blocks_js_inline('default', true)|raw }}

Blog

Enhance your Sonata project with the built-in blog feature of the Sonata Extra Bundle.

  • Documentation: blog.md
  • Multilingual custom URLs: Custom_BlogUrl.png
  • Type of blog service: Blog_ServiceType.png

Content Security Policy

The Content Security Policy (CSP) is a crucial security feature in web development, helping to prevent various types of attacks, such as Cross-Site Scripting (XSS) and data injection attacks. The Sonata-Extra bundle for Symfony provides an effective way to implement and manage CSP in your application.

config_security_policy.png

  • Rendered header:

security_policy_result.png

Header Redirect Manager

Manage all your header redirects

Language selector

Sonata Extra Bundle offers a feature-rich language selector, compatible with hybrid pages.

Multilingual management with Sonata Page

The Sonata Extra Bundle enhances the SonataPageBundle by offering full multisite and multilingual management capabilities. This feature allows tracking and switching between page translations on the front-end and supports a flexible multisite strategy.

Multilingual administrations

Multilingual support for administration interfaces. It includes a trait for administration classes to manage multilingual interfaces, and a trait for entities to create the necessary fields. The implementation will add icons for local languages. from sonata_page sites, allowing links with the records and the management of all the languages of the sites.

Firewall

Provides a set of enhanced features for managing firewall rules in the Sonata Admin environment. This bundle allows administrators to create and manage rules to filter requests based on various criteria such as forbidden words, IP addresses, and user agents.

Integration with PrestaSitemapBundle Our application automatically integrates with the "PrestaSitemapBundle" to generate a sitemap.xml file. This feature includes all image elements, article modules, and content pages within the application. The process is fully automated and includes support for multilingual links.

Intelligent services (AI-powered services)

Translation Sonata Extra Bundle offers a powerful feature for automatic translation thanks to its Smart service feature. This feature allows users to easily translate text between different languages using AI-powered translation providers.

Translation command

A command to automate the translation of a selected language for an administrator object.

Translation model

Import WordPress

The sonata-extra:wordpress-importer command is designed to import images, categories, posts, and tags from a WordPress site into your application. This command is essential for easily integrating WordPress content.

Blocks

Cookie Consent Block (GDPR)

The cookie consent block is a customizable solution integrated into the Sonata Extra Bundle to manage user consent for cookies in accordance with GDPR regulations. It offers a flexible and user-friendly interface for managing cookie consent.

Form types

Gutenberg Editor

Integrating the Gutenberg editor into Sonata involves using the 'Automatic Isolated Block Editor' library. This guide details the necessary steps to install and configure the Gutenberg editor in your Sonata application.

Cursor manager with Sonata page block

  • Overview : Cursor manager overview
  • Add sliders to the Sonata page with customizable blocks

FAQ manager with Sonata page block

  • Easily integrate FAQs into your Sonata pages
  • List of FAQs: faq_list.png
  • Questions : faq_questions.png
  • Block : faq_block.png
  • Page Edit : faq_page.png

Sonata Page Block Manager

  • Hide unwanted blocks in the Sonata page block manager
  • Overview : Overview of the block manager

Article manager with the Gutenberg editor

  • Write articles using the Gutenberg editor
  • Gutenberg Editor: article_editor_gutemberg.png
  • Editor Selector : article_editor_selector.png

Sonata administration forms

  • Types of additional forms for Sonata Admin
  • Gutenberg Editor: article_editor_gutemberg.png
  • Markdown Editor: Markdown_editor.png

Gutenberg editor with advanced features

  • The Gutenberg editor of WordPress with file upload, custom templates, and SonataMedia gallery
  • Editor view:Gutenberg Preview
  • Selection of blocks: Gutenberg Preview
  • Pattern selection: Gutenberg Preview
  • Multimedia library: Gutenberg Preview
  • Detailed view of the media library: Gutenberg Preview

CKEditor Gallery View

  • Display galleries in CKEditor with an enhanced user interface
  • Select the media:Gutenberg Preview
  • Media browser window: Gutenberg Preview
  • Overview : Preview of the CKEditor gallery view

WordPress Automatic Importer


Adapt the example to the installed version

The Symfony and Sonata examples remain tied to the versions indicated in the article. Symfony 4.x and Symfony 6.2 are no longer maintained: for a current project, use a maintained branch and the documentation that exactly matches your dependencies.

php bin/console about
composer show symfony/framework-bundle sonata-project/admin-bundle

Before resuming the code, check the signatures, services, routes, and templates concerned. Then add a functional test covering permissions, HTTP code, and the visible result.

Reference: maintained Symfony versions.

Share this article