### Install SuluEventBundle with Composer Source: https://github.com/manuxi/sulueventbundle/blob/3.x/README.md This command installs the SuluEventBundle package using Composer. Ensure you have Composer installed and are in the root directory of your Sulu project. ```bash composer require manuxi/sulu-event-bundle ``` -------------------------------- ### Install Dependencies and Build Assets Source: https://github.com/manuxi/sulueventbundle/blob/3.x/docs/list-transformer.en.md After modifying package.json, install the new dependencies and build the admin assets using npm. This ensures that the bundled assets are up-to-date with the added dependency. ```bash npm install npm run build ``` -------------------------------- ### Install FullCalendar and Bootstrap-Icons Dependencies (npm) Source: https://github.com/manuxi/sulueventbundle/blob/3.x/docs/calendar.en.md Installs the necessary FullCalendar packages, Bootstrap-Icons for styling, and core-js for polyfills using npm. This is a prerequisite for the calendar feature. ```bash npm install --save @fullcalendar/core@^6.1.19 @fullcalendar/bootstrap5@^6.1.19 @fullcalendar/daygrid@^6.1.19 @fullcalendar/timegrid@^6.1.19 @fullcalendar/list@^6.1.19 @fullcalendar/multimonth@^6.1.19 bootstrap-icons@^1.13.1 npm install --save-dev core-js@^3.38.1 ``` -------------------------------- ### Sitemap XML Example Source: https://github.com/manuxi/sulueventbundle/blob/3.x/docs/sitemap.en.md An example of how an event URL appears within the generated sitemap.xml file. This showcases the structure including the location and last modified date. ```xml https://example.org/events/my-great-event 2024-03-20T10:00:00+00:00 ``` -------------------------------- ### Install FullCalendar and Bootstrap-Icons Dependencies (yarn) Source: https://github.com/manuxi/sulueventbundle/blob/3.x/docs/calendar.en.md Installs the necessary FullCalendar packages, Bootstrap-Icons for styling, and core-js for polyfills using yarn. This is an alternative to npm for dependency management. ```bash yarn add @fullcalendar/core@^6.1.19 @fullcalendar/bootstrap5@^6.1.19 @fullcalendar/daygrid@^6.1.19 @fullcalendar/timegrid@^6.1.19 @fullcalendar/list@^6.1.19 @fullcalendar/multimonth@^6.1.19 bootstrap-icons@^1.13.1 yarn add --dev core-js@^3.38.1 ``` -------------------------------- ### Get Social Profile URL - Twig Example Source: https://github.com/manuxi/sulueventbundle/blob/3.x/docs/social-media.en.md Shows how to use the `social_profile_url` Twig function to retrieve and display a link to an event's social media profile. It checks if the profile URL exists before rendering the link. ```twig {% if social_profile_url(event, 'instagram') %} Follow us on Instagram {% endif %} ``` -------------------------------- ### Location Management API Source: https://context7.com/manuxi/sulueventbundle/llms.txt Manage event locations, including address details, coordinates, media, and premises. This section provides PHP examples for creating and retrieving location data. ```APIDOC ## Location Management Create and manage event locations with full address details, coordinates, media attachments, and room/premises support. ### Service Usage (PHP) ```php use Manuxi\SuluEventBundle\Repository\LocationRepository; use Manuxi\SuluEventBundle\Entity\Location; class LocationService { public function __construct( private LocationRepository $locationRepository ) {} public function createLocation(): Location { $location = $this->locationRepository->create(); $location->setName('Tech Conference Center'); $location->setStreet('Innovation Drive'); $location->setNumber('123'); $location->setPostalCode('12345'); $location->setCity('San Francisco'); $location->setState('CA'); $location->setCountryCode('US'); $location->setEmail('info@techcenter.com'); $location->setPhoneNumber('+1-555-0123'); $location->setLink('https://techcenter.com'); // Set coordinates (stored as JSON: {"lat": 37.7749, "lng": -122.4194}) $location->setLocation(json_encode([ 'lat' => 37.7749, 'lng' => -122.4194 ])); // Set premises/rooms (stored as JSON array) $location->setPremises(json_encode([ 'conference-room-a' => 'Conference Room A', 'conference-room-b' => 'Conference Room B', 'auditorium' => 'Main Auditorium' ])); $location->setNotes('Parking available on-site. Wheelchair accessible.'); return $this->locationRepository->save($location); } public function getLocationDetails(int $id): ?array { $location = $this->locationRepository->findById($id); if (!$location) { return null; } return [ 'name' => $location->getName(), 'address' => sprintf( '%s %s, %s %s', $location->getStreet(), $location->getNumber(), $location->getPostalCode(), $location->getCity() ), 'latitude' => $location->getLatitude(), 'longitude' => $location->getLongitude(), 'fullName' => $location->getFullName(), 'avatar' => $location->getAvatar() ]; } } ``` ``` -------------------------------- ### Event Type Configuration (PHP Service) Source: https://context7.com/manuxi/sulueventbundle/llms.txt This PHP service demonstrates how to configure and retrieve event types, including their names and colors, using the EventTypeSelect service. It shows methods for getting all types, individual type names, colors, checking existence, and retrieving the default type. ```php use Manuxi\SuluEventBundle\Service\EventTypeSelect; class EventTypeService { public function __construct( private EventTypeSelect $eventTypeSelect ) {} public function getEventTypeInfo(): array { // Get all defined event types $types = $this->eventTypeSelect->getTypes(); // Returns: ['default', 'workshop', 'conference', 'webinar', ...] // Get type name (translated) $name = $this->eventTypeSelect->getTypeName('workshop'); // Returns: "Workshop" // Get type color $color = $this->eventTypeSelect->getColor('workshop'); // Returns: "#3788d8" // Check if type exists if ($this->eventTypeSelect->hasType('conference')) { // Type exists } // Get default type $default = $this->eventTypeSelect->getDefaultValue(); // Returns: "default" return [ 'types' => $types, 'colors' => array_map( fn($type) => $this->eventTypeSelect->getColor($type), $types ) ]; } } ``` -------------------------------- ### Event Type Configuration Source: https://context7.com/manuxi/sulueventbundle/llms.txt Configure custom event types with names, colors, and default settings. This documentation includes PHP service examples and Twig template usage. ```APIDOC ## Event Type Configuration Define custom event types with colors for visual categorization in calendars and listings. ### Service Usage (PHP) ```php use Manuxi\SuluEventBundle\Service\EventTypeSelect; class EventTypeService { public function __construct( private EventTypeSelect $eventTypeSelect ) {} public function getEventTypeInfo(): array { // Get all defined event types $types = $this->eventTypeSelect->getTypes(); // Returns: ['default', 'workshop', 'conference', 'webinar', ...] // Get type name (translated) $name = $this->eventTypeSelect->getTypeName('workshop'); // Returns: "Workshop" // Get type color $color = $this->eventTypeSelect->getColor('workshop'); // Returns: "#3788d8" // Check if type exists if ($this->eventTypeSelect->hasType('conference')) { // Type exists } // Get default type $default = $this->eventTypeSelect->getDefaultValue(); // Returns: "default" return [ 'types' => $types, 'colors' => array_map( fn($type) => $this->eventTypeSelect->getColor($type), $types ) ]; } } ``` ### Template Usage (Twig) ```twig {# Get event type color and name in templates #} {{ sulu_event_type_name(event.type) }} ``` ### Configuration (YAML) ```yaml # config/packages/sulu_event.yaml sulu_event: types: default: name: 'Default' color: '#cccccc' workshop: name: 'Workshop' color: '#3788d8' conference: name: 'Conference' color: '#e74c3c' webinar: name: 'Webinar' color: '#2ecc71' meetup: name: 'Meetup' color: '#f39c12' default_type: 'default' routing: route_schema: '/{parent}/{object.getTitle()}' list_date_format: 'clock_format' # default, clock_format, time_labels ``` ``` -------------------------------- ### Generate Social Share URL - Twig Example Source: https://github.com/manuxi/sulueventbundle/blob/3.x/docs/social-media.en.md Demonstrates the usage of the `social_share_url` Twig function to generate a sharing URL for a specific social media platform. This function takes the event object and the platform name as arguments. ```twig {{ social_share_url(event, 'facebook') }} ``` -------------------------------- ### Complete Social Sharing Integration - Twig Source: https://github.com/manuxi/sulueventbundle/blob/3.x/docs/social-media.en.md A comprehensive example of integrating social media sharing and profile links into an event detail page. It includes conditional display of buttons for various platforms and links to social profiles. ```twig

{{ event.title }}

{% if event.socialSettings and event.socialSettings.enableSharing %}

Share this Event

Follow Us

{% if social_profile_url(event, 'facebook') %} Facebook {% endif %} {% if social_profile_url(event, 'instagram') %} Instagram {% endif %}
{% endif %}
``` -------------------------------- ### Schema.org Event Markup with Location (JavaScript) Source: https://github.com/manuxi/sulueventbundle/blob/3.x/docs/locations.en.md This snippet provides a JSON-LD script for embedding Schema.org event markup. It includes dynamic fields for event name, start date, and detailed location information, supporting address components and geographical coordinates if available. This is typically used within a web page's head or body to improve search engine understanding of event data. ```javascript ``` -------------------------------- ### Configure Website Routes for SuluEventBundle Source: https://github.com/manuxi/sulueventbundle/blob/3.x/README.md For features like FullCalendar integration, iCal export, and RSS/Atom feeds, add the website-specific routes to your `routes_website.yaml`. This enables the bundle's public-facing functionalities. ```yaml SuluEventBundle: resource: '@SuluEventBundle/Resources/config/routes_website.yaml' ``` -------------------------------- ### Get Locations using REST API Source: https://context7.com/manuxi/sulueventbundle/llms.txt This snippet demonstrates how to retrieve a list of all managed locations using a GET request to the locations API endpoint. This is useful for referencing existing locations when creating or updating events. ```shell curl -X GET "https://example.com/admin/api/locations.json" ``` -------------------------------- ### Configure Admin Routes for SuluEventBundle Source: https://github.com/manuxi/sulueventbundle/blob/3.x/README.md Add the admin-specific routes for the SuluEventBundle to your `routes_admin.yaml` configuration file. This makes the bundle's admin interface accessible within the Sulu backend. ```yaml SuluEventBundle: resource: '@SuluEventBundle/Resources/config/routes_admin.yaml' ``` -------------------------------- ### Get Event Version History using REST API Source: https://context7.com/manuxi/sulueventbundle/llms.txt This snippet shows how to retrieve the version history for a specific event using a GET request to the event's versions API endpoint. The event ID is included in the URL. This is useful for auditing and reverting changes. ```shell curl -X GET "https://example.com/admin/api/events/42/versions.json" ``` -------------------------------- ### Copy and Configure List XML Source: https://github.com/manuxi/sulueventbundle/blob/3.x/docs/list-transformer.en.md Copy the event list configuration XML file to your project's config directory and then add the transformer configuration to the 'type' property. This links the visual transformer to the 'type' field in your event lists. ```bash cp src/Resources/config/lists/events.xml => [Projekt]/config/lists/events.xml ``` ```xml type %sulu.model.event.class% ``` -------------------------------- ### Overwrite Event Date Properties in XML Source: https://github.com/manuxi/sulueventbundle/blob/3.x/docs/list-view.en.md This XML snippet shows how to define 'startDate' and 'endDate' properties for events. These configurations are typically overwritten in the default 'events.xml' for flexibility. Copying and adjusting the 'Resources/config/lists/events.xml' file allows for custom date handling. ```xml startDate %sulu.model.event.class% endDate %sulu.model.event.class% ``` -------------------------------- ### Get Single Event (Admin API) Source: https://context7.com/manuxi/sulueventbundle/llms.txt This cURL command shows how to retrieve details for a specific event using its ID via the admin API. ```bash # Get single event curl -X GET "https://example.com/admin/api/events/42.json" ``` -------------------------------- ### List All Events (Admin API) Source: https://context7.com/manuxi/sulueventbundle/llms.txt This cURL command demonstrates how to list all events using the admin API. It includes parameters for locale, pagination, limiting results, and specifying desired fields. ```bash # List all events (with pagination and filters) curl -X GET "https://example.com/admin/api/events.json?locale=en&page=1&limit=10&fields=id,title,startDate,location" ``` -------------------------------- ### Retrieve Events using EventRepository Query Methods in PHP Source: https://context7.com/manuxi/sulueventbundle/llms.txt This PHP code demonstrates how to use the EventRepository to fetch events with various filtering and sorting options. It covers finding upcoming events, events by date range, recurring events, and counting published events. ```php use Manuxi\SuluEventBundle\Repository\EventRepository; use Sulu\Content\Domain\Model\DimensionContentInterface; class EventService { public function __construct( private EventRepository $eventRepository ) {} public function getUpcomingEvents(): array { // Find events by filters with comprehensive options $filters = [ 'locale' => 'en', 'stage' => DimensionContentInterface::STAGE_LIVE, 'startDate' => new \DateTime('now'), 'categoryIds' => [1, 5, 8], 'categoryOperator' => 'OR', 'tagNames' => ['featured', 'workshop'], 'tagOperator' => 'AND', 'types' => ['workshop', 'conference'], 'locationId' => 3, 'limit' => 10, 'offset' => 0, ]; $sortBys = [ ['field' => 'startDate', 'order' => 'ASC'] ]; return $this->eventRepository->findByFilters($filters, $sortBys, []); } public function getEventsByDateRange(): array { $start = new \DateTime('2024-01-01'); $end = new \DateTime('2024-12-31'); return $this->eventRepository->findByDateRange('en', $start, $end); } public function getRecurringEvents(): array { return $this->eventRepository->findRecurringEvents('en'); } public function countPublishedEvents(): int { return $this->eventRepository->countPublished('en'); } } ``` -------------------------------- ### Generate Full Calendar Feed Source: https://context7.com/manuxi/sulueventbundle/llms.txt Generates an iCal feed for all events, supporting filtering by locale, category IDs, tag names, and start date. This is typically used for calendar application subscriptions. ```APIDOC ## GET /api/events/ical ### Description Generates an iCal feed for all events with optional filtering parameters. This endpoint is designed for calendar application subscriptions. ### Method GET ### Endpoint /api/events/ical ### Query Parameters - **_locale** (string) - Optional - The locale for the iCal feed. - **categories** (array) - Optional - Filter events by category IDs. - **tags** (array) - Optional - Filter events by tag names. - **startDate** (string) - Optional - Filter events starting from this date (YYYY-MM-DD format). ### Request Example ``` GET /api/events/ical?_locale=en&categories[]=1&categories[]=5&tags[]=conference&startDate=2023-10-27 ``` ### Response #### Success Response (200) - **body** (string) - The iCal formatted string for the event feed. #### Response Example ```ical BEGIN:VCALENDAR VERSION:2.0 PRODID:-//SuluEventBundle//iCal Generator//EN CALSCALE:GREGORIAN ... END:VCALENDAR ``` ``` -------------------------------- ### Update Database Schema (Bash) Source: https://github.com/manuxi/sulueventbundle/blob/3.x/docs/fixtures.en.md Updates the database schema to ensure necessary tables exist before loading fixtures. The `--force` option applies the schema changes without interactive confirmation. ```bash php bin/console doctrine:schema:update --force ``` -------------------------------- ### Load Event Fixtures (Bash) Source: https://github.com/manuxi/sulueventbundle/blob/3.x/docs/fixtures.en.md Loads the event fixtures using the Symfony console. The `--group=events` option ensures only event-related fixtures are loaded, and `--append` adds data without purging the database. ```bash php bin/console doctrine:fixtures:load --group=events --append ``` -------------------------------- ### Import Calendar SCSS (Optional) Source: https://github.com/manuxi/sulueventbundle/blob/3.x/docs/calendar.en.md Imports the calendar SCSS file into the website's main SCSS file. This applies the default styling for the calendar feature. ```scss @import '../../../vendor/manuxi/sulu-event-bundle/src/Resources/public/scss/calendar.scss'; ``` -------------------------------- ### Get Event Type Color and Name in Twig Source: https://github.com/manuxi/sulueventbundle/blob/3.x/docs/event-types.en.md Demonstrates how to retrieve the color and translated name of an event type within a Twig template using provided Sulu helper functions. These functions abstract the logic for accessing event type data. ```twig {# Get color for event type #} {% set color = sulu_event_type_color(event.type) %} {# Get translated name #} {% set typeName = sulu_event_type_name(event.type) %} ``` -------------------------------- ### EventRepository Query Methods Source: https://context7.com/manuxi/sulueventbundle/llms.txt Methods for retrieving events using the EventRepository, allowing for flexible filtering and sorting. ```APIDOC ## EventRepository Query Methods ### Description Provides methods to query and retrieve event data from the database using various filtering and sorting criteria. ### Methods #### `findByFilters(array $filters, array $sortBys, array $limitOffset)` Retrieves events based on a comprehensive set of filters. **Parameters:** - **filters** (array) - An associative array of filter criteria: - `locale` (string) - Required - The locale for the events. - `stage` (string) - Optional - The content stage ('draft' or 'live'). Defaults to 'live'. - `startDate` (DateTime) - Optional - Filter events starting on or after this date. - `endDate` (DateTime) - Optional - Filter events ending on or before this date. - `categoryIds` (array) - Optional - Array of category IDs to filter by. - `categoryOperator` (string) - Optional - Operator for category filtering ('AND' or 'OR'). Defaults to 'OR'. - `tagNames` (array) - Optional - Array of tag names to filter by. - `tagOperator` (string) - Optional - Operator for tag filtering ('AND' or 'OR'). Defaults to 'AND'. - `types` (array) - Optional - Array of event types to filter by. - `locationId` (integer) - Optional - Filter events by location ID. - `limit` (integer) - Optional - Maximum number of events to return. Defaults to null (no limit). - `offset` (integer) - Optional - Number of events to skip. Defaults to 0. - **sortBys** (array) - An array of sorting configurations. Each element is an associative array: - `field` (string) - The field to sort by (e.g., 'startDate', 'title'). - `order` (string) - The sorting order ('ASC' or 'DESC'). - **limitOffset** (array) - Optional - Overrides `limit` and `offset` from the filters array. Should contain `limit` and `offset` keys. #### `findByDateRange(string $locale, DateTimeInterface $start, DateTimeInterface $end, ?string $stage = 'live')` Retrieves events within a specified date range and locale. **Parameters:** - **locale** (string) - Required - The locale for the events. - **start** (DateTimeInterface) - Required - The start date of the range. - **end** (DateTimeInterface) - Required - The end date of the range. - **stage** (string) - Optional - The content stage ('draft' or 'live'). Defaults to 'live'. #### `findRecurringEvents(string $locale, ?string $stage = 'live')` Retrieves all recurring events for a given locale and stage. **Parameters:** - **locale** (string) - Required - The locale for the events. - **stage** (string) - Optional - The content stage ('draft' or 'live'). Defaults to 'live'. #### `countPublished(string $locale, ?string $stage = 'live')` Counts the number of published events for a given locale and stage. **Parameters:** - **locale** (string) - Required - The locale for the events. - **stage** (string) - Optional - The content stage ('draft' or 'live'). Defaults to 'live'. ### PHP Example Usage ```php use Manuxi\SuluEventBundle\Repository\EventRepository; use Sulu\Content\Domain\Model\DimensionContentInterface; class EventService { public function __construct( private EventRepository $eventRepository ) {} public function getUpcomingEvents(): array { // Find events by filters with comprehensive options $filters = [ 'locale' => 'en', 'stage' => DimensionContentInterface::STAGE_LIVE, 'startDate' => new \DateTime('now'), 'categoryIds' => [1, 5, 8], 'categoryOperator' => 'OR', 'tagNames' => ['featured', 'workshop'], 'tagOperator' => 'AND', 'types' => ['workshop', 'conference'], 'locationId' => 3, 'limit' => 10, 'offset' => 0, ]; $sortBys = [ ['field' => 'startDate', 'order' => 'ASC'] ]; return $this->eventRepository->findByFilters($filters, $sortBys, []); } public function getEventsByDateRange(): array { $start = new \DateTime('2024-01-01'); $end = new \DateTime('2024-12-31'); return $this->eventRepository->findByDateRange('en', $start, $end); } public function getRecurringEvents(): array { return $this->eventRepository->findRecurringEvents('en'); } public function countPublishedEvents(): int { return $this->eventRepository->countPublished('en'); } } ``` ``` -------------------------------- ### Set Default Date and Datetime Formats in YAML Source: https://github.com/manuxi/sulueventbundle/blob/3.x/docs/list-view.en.md This YAML configuration snippet defines the default formats for displaying dates and datetimes within the SuluEventBundle. These settings are crucial for consistent date presentation across the application, utilizing locale strings for formatting. ```yaml sulu_event: # Formats date_format: 'm/d/Y' datetime_format: 'm/d/Y h:i A' ``` -------------------------------- ### Generate Full Calendar Feed (PHP) Source: https://context7.com/manuxi/sulueventbundle/llms.txt Generates a full iCal feed for calendar subscriptions, allowing for filtering by locale, category IDs, tag names, and start date. This functionality is crucial for users to subscribe to event calendars in their preferred applications. It utilizes the ICalGenerator and EventRepository services. ```php use Manuxi\SuluEventBundle\Service\ICalGenerator; use Manuxi\SuluEventBundle\Repository\EventRepository; class ICalService { public function __construct( private ICalGenerator $iCalGenerator, private EventRepository $eventRepository ) {} public function generateFullCalendarFeed(): string { // Generate iCal feed with filters $filters = [ 'locale' => 'en', 'categoryIds' => [1, 5], 'tagNames' => ['public', 'conference'], 'startDate' => new \DateTime('now') ]; return $this->iCalGenerator->generate($filters, 'en'); } public function generateSingleEventICal(int $eventId): string { $event = $this->eventRepository->findById($eventId); if (!$event) { throw new \RuntimeException('Event not found'); } /** @var EventDimensionContent $dimensionContent */ $dimensionContent = $this->contentAggregator->aggregate( $event, ['locale' => 'en', 'stage' => DimensionContentInterface::STAGE_LIVE] ); return $this->iCalGenerator->generateSingle($event, $dimensionContent); } } ``` -------------------------------- ### Configure Babel Preset Env Polyfills (webpack.config.js) Source: https://github.com/manuxi/sulueventbundle/blob/3.x/docs/calendar.en.md Configures Babel Preset Env in webpack.config.js to use polyfills based on usage. This ensures compatibility with older browsers by including necessary JavaScript features. ```javascript // enables and configure @babel/preset-env polyfills Encore.configureBabelPresetEnv((config) => { config.useBuiltIns = 'usage'; config.corejs = { version: 3, proposals: true }; }) ``` -------------------------------- ### Create Location Entity (PHP Service) Source: https://context7.com/manuxi/sulueventbundle/llms.txt This PHP service demonstrates how to create a new event location using the LocationRepository. It sets various details including name, address, contact information, coordinates, premises, and notes. ```php use Manuxi\SuluEventBundle\Repository\LocationRepository; use Manuxi\SuluEventBundle\Entity\Location; class LocationService { public function __construct( private LocationRepository $locationRepository ) {} public function createLocation(): Location { $location = $this->locationRepository->create(); $location->setName('Tech Conference Center'); $location->setStreet('Innovation Drive'); $location->setNumber('123'); $location->setPostalCode('12345'); $location->setCity('San Francisco'); $location->setState('CA'); $location->setCountryCode('US'); $location->setEmail('info@techcenter.com'); $location->setPhoneNumber('+1-555-0123'); $location->setLink('https://techcenter.com'); // Set coordinates (stored as JSON: {"lat": 37.7749, "lng": -122.4194}) $location->setLocation(json_encode([ 'lat' => 37.7749, 'lng' => -122.4194 ])); // Set premises/rooms (stored as JSON array) $location->setPremises(json_encode([ 'conference-room-a' => 'Conference Room A', 'conference-room-b' => 'Conference Room B', 'auditorium' => 'Main Auditorium' ])); $location->setNotes('Parking available on-site. Wheelchair accessible.'); return $this->locationRepository->save($location); } public function getLocationDetails(int $id): ?array { $location = $this->locationRepository->findById($id); if (!$location) { return null; } return [ 'name' => $location->getName(), 'address' => sprintf( '%s %s, %s %s', $location->getStreet(), $location->getNumber(), $location->getPostalCode(), $location->getCity() ), 'latitude' => $location->getLatitude(), 'longitude' => $location->getLongitude(), 'fullName' => $location->getFullName(), 'avatar' => $location->getAvatar() ]; } } ``` -------------------------------- ### Import Bootstrap-Icons CSS Source: https://github.com/manuxi/sulueventbundle/blob/3.x/docs/calendar.en.md Imports the Bootstrap-Icons CSS file. This is necessary for the calendar overlays and other UI elements to display correctly. ```javascript import 'bootstrap-icons/font/bootstrap-icons.css'; ``` -------------------------------- ### Debug Event Search Index (CLI) Source: https://context7.com/manuxi/sulueventbundle/llms.txt This command allows for debugging the search index for events. It is a command-line interface tool provided by the SuluEventBundle. ```bash # Debug search index for events php bin/console sulu:event:debug-search ``` -------------------------------- ### Register SuluEventBundle in Symfony Source: https://github.com/manuxi/sulueventbundle/blob/3.x/README.md If not using Symfony Flex, manually register the SuluEventBundle by adding its class to the `config/bundles.php` file. This ensures the bundle is loaded by the Symfony application. ```php return [ //... Manuxi\SuluEventBundle\SuluEventBundle::class => ['all' => true], ]; ``` -------------------------------- ### Update Database Schema Source: https://github.com/manuxi/sulueventbundle/blob/3.x/README.md These commands are used to update the database schema to reflect the changes introduced by the SuluEventBundle. First, dump the SQL to review changes, then apply them forcefully. ```bash # Check what will be created php bin/console doctrine:schema:update --dump-sql # Execute migration php bin/console doctrine:schema:update --force ``` -------------------------------- ### Display Location Contact Information in Twig Source: https://github.com/manuxi/sulueventbundle/blob/3.x/docs/locations.en.md Renders email, phone number, website link, and PDF download link for a location, if they exist. Includes conditional logic for target attributes and default link titles. ```html {% if location.email %} {{ location.email }} {% endif %} {% if location.phoneNumber %} {{ location.phoneNumber }} {% endif %} {% if location.link %} {{ location.link.title ?: 'Website' }} {% endif %} {% if location.pdf %} Download PDF {% endif %} {% if location.latitude and location.longitude %} {# Map integration #}
{% endif %} {% if location.images %} {% endif %} ``` -------------------------------- ### Configure List Date Format in YAML Source: https://github.com/manuxi/sulueventbundle/blob/3.x/docs/list-view.en.md This YAML configuration snippet demonstrates how to set the 'list_date_format' for the SuluEventBundle. The 'list_date_format' controls how dates and times are displayed in list views, with options like 'time_labels', 'clock_format', and 'default'. ```yaml sulu_event: list_date_format: “time_labels” # “time_labels”, “clock_format”, “default” ``` -------------------------------- ### Configure SuluEventBundle Calendar View Selector Source: https://github.com/manuxi/sulueventbundle/blob/3.x/docs/calendar.en.md This XML snippet defines a configuration property for 'allowedCalendarViews' within the Sulu backend. It uses a 'select' type and is visible based on a parent condition. It allows users to choose from predefined calendar views like 'dayGridMonth', 'timeGridWeek', and 'listMonth', with language-specific titles for each option. ```xml sulu_event.config.properties.allowed_calendar_views sulu_event.config.properties.allowed_calendar_views_info Week with Times Woche (mit Uhrzeiten) Month Grid Monat (Raster) Year Overview Jahresübersicht Week List Wochenliste Month List Monatsliste ``` -------------------------------- ### Publish Event using REST API Source: https://context7.com/manuxi/sulueventbundle/llms.txt This snippet demonstrates how to publish an event by sending a POST request to the event's API endpoint with the 'publish' action. This typically triggers a workflow or status change for the event. The event ID is included in the URL. ```shell curl -X POST "https://example.com/admin/api/events/42.json?action=publish" ``` -------------------------------- ### Combined iCal Subscription Options (Webcal and Download) Source: https://github.com/manuxi/sulueventbundle/blob/3.x/docs/feeds-ical.en.md Offers users two options for subscribing to the event calendar: a direct subscription via the 'webcal://' protocol (recommended) or downloading the calendar as an .ics file. This provides flexibility for different user preferences and calendar applications. Twig templating is used for URL generation. ```html

Subscribe to Calendar

Click one of the following links to subscribe:

``` -------------------------------- ### iCal Event Integration (Twig) Source: https://context7.com/manuxi/sulueventbundle/llms.txt Provides Twig templates for integrating iCal functionality into a web application. This includes a download button for single events and a subscription link for full calendar feeds using the webcal protocol. RSS and Atom feed links are also included for broader syndication. ```twig {# Single event download button #} Add to Calendar {# Calendar subscription link (webcal protocol) #} Subscribe to Calendar {# RSS/Atom feed links #} ``` -------------------------------- ### Location Management API Source: https://context7.com/manuxi/sulueventbundle/llms.txt Endpoints for managing event locations. ```APIDOC ## GET /admin/api/locations.json ### Description Retrieves a list of all available locations. ### Method GET ### Endpoint /admin/api/locations.json ### Response #### Success Response (200 OK) - **locations** (array) - An array of location objects. - **id** (integer) - The ID of the location. - **name** (string) - The name of the location. - **street** (string) - The street address. - **number** (string) - The street number. - **postalCode** (string) - The postal code. - **city** (string) - The city. #### Response Example { "locations": [ { "id": 5, "name": "Conference Center", "street": "Main Street", "number": "123", "postalCode": "12345", "city": "San Francisco" } ] } --- ## POST /admin/api/locations.json ### Description Creates a new location. ### Method POST ### Endpoint /admin/api/locations.json ### Parameters #### Request Body - **name** (string) - Required - The name of the location. - **street** (string) - Required - The street address. - **number** (string) - Required - The street number. - **postalCode** (string) - Required - The postal code. - **city** (string) - Required - The city. ### Request Example { "name": "Conference Center", "street": "Main Street", "number": "123", "postalCode": "12345", "city": "San Francisco" } ### Response #### Success Response (201 Created) - **id** (integer) - The ID of the newly created location. - **message** (string) - Confirmation message. #### Response Example { "id": 6, "message": "Location created successfully." } --- ## PUT /admin/api/locations/{id}.json ### Description Updates an existing location. ### Method PUT ### Endpoint /admin/api/locations/{id}.json ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the location to update. #### Request Body - **name** (string) - Optional - The updated name of the location. ### Request Example { "name": "Updated Name" } ### Response #### Success Response (200 OK) - **id** (integer) - The ID of the updated location. - **message** (string) - Confirmation message. #### Response Example { "id": 5, "message": "Location updated successfully." } --- ## DELETE /admin/api/locations/{id}.json ### Description Deletes a location. ### Method DELETE ### Endpoint /admin/api/locations/{id}.json ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the location to delete. ### Response #### Success Response (200 OK) - **message** (string) - Confirmation message. #### Response Example { "message": "Location deleted successfully." } ``` -------------------------------- ### Schedule Recurring Event Generation (Cronjob) Source: https://context7.com/manuxi/sulueventbundle/llms.txt This snippet shows how to schedule the daily generation of recurring events using cron. It ensures that the event generation command runs at a specific time each day. ```bash # Schedule in crontab (daily at 2:00 AM) # 0 2 * * * cd /var/www/project && php bin/console sulu:events:generate-recurring ``` -------------------------------- ### Configure Recurring Event Rules (YAML) Source: https://context7.com/manuxi/sulueventbundle/llms.txt Defines the recurrence pattern for an event using YAML configuration. Specifies frequency (daily, weekly, monthly, yearly), interval, days of the week, and end conditions (never, count, until). This configuration is used by the recurrence generation service. ```yaml # Configure EventRecurrence entity data recurrence: isRecurring: true frequency: 'weekly' # daily, weekly, monthly, yearly interval: 2 # Every 2 weeks byWeekday: ['MO', 'WE', 'FR'] # Monday, Wednesday, Friday endType: 'count' # never, count, until count: 10 # Stop after 10 occurrences until: null ``` -------------------------------- ### Configure Sass Loader for Project Variables (webpack.config.js) Source: https://github.com/manuxi/sulueventbundle/blob/3.x/docs/calendar.en.md Configures the Sass loader in webpack.config.js to include project-specific variable files. This ensures consistent styling across the project and the calendar feature. ```javascript Encore.enableSassLoader(options => { options.sassOptions = { includePaths: [ 'assets/website/scss', ], }; options.additionalData = ` @import "config/variables"; @import "config/variables.components"; `; }) ``` -------------------------------- ### Generate Recurring Event Occurrences (Console Command) Source: https://context7.com/manuxi/sulueventbundle/llms.txt A console command to generate physical event entries based on recurring event configurations. It can be scheduled to run regularly (e.g., daily via cron). The command accepts a lookahead period and locale as arguments. This automates the creation of future event instances. ```bash # Generate recurring event occurrences via console command # Run daily via cron to create physical event entries php bin/console sulu:events:generate-recurring --lookahead=90 --locale=en ```