Files
eventmanager-bundle/src/DependencyInjection/EventManagerExtension.php
T
admin.juergenandClaude Opus 5.5 5bf31e5043 SEO: event meta title with date, Open Graph defaults, cache invalidation
- event detail pages: <title> is "Title – 03.12.2026" (multi-day ranges
  supported) so recurring events with the same name stay distinguishable;
  H1 and lists keep the editor's title
- meta description fallback for events without teaser/description (date,
  time, location); a teaser that is only an insert tag (shared series
  text) also falls back, so a series does not share one description
- EventOpenGraphProvider for numero2/contao-opengraph3 (registered only
  when the bundle is installed, priority above its CalendarEventsProvider):
  og:title with date, og:description from teaser, event image as og:image
- FrontendCacheInvalidator: frontend event/organization edits write via
  DBAL, so invalidate the same cache tags the backend uses; tag the map
  and organization listing, invalidate the generic organization tag on
  backend saves

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 16:58:33 +01:00

31 lines
1.2 KiB
PHP

<?php
declare(strict_types=1);
namespace Mummert\EventManagerBundle\DependencyInjection;
use Mummert\EventManagerBundle\OpenGraph\EventOpenGraphProvider;
use numero2\Opengraph3Bundle\OpenGraph\Provider\ProviderInterface;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
class EventManagerExtension extends Extension
{
public function load(array $configs, ContainerBuilder $container): void
{
$loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../../config'));
$loader->load('services.yaml');
// Open-Graph-Standardwerte für Events, nur wenn numero2/contao-opengraph3 installiert ist.
// Höhere Priorität als dessen eigener CalendarEventsProvider (der erste passende Provider gewinnt).
if (interface_exists(ProviderInterface::class)) {
$container->register(EventOpenGraphProvider::class, EventOpenGraphProvider::class)
->setAutowired(true)
->setAutoconfigured(false)
->addTag('numero2_opengraph3.provider', ['priority' => 10]);
}
}
}