Configuration
After installing the module, you can place and configure the FullCalendar block.
- Go to the Block layout configuration page (
/admin/structure/block
). - Click the 'Place block' button in the area you want the calendar block take place.
- In the pop-up dialog search 'FullCalendar block' and then place the block.
- Click the 'Configure' button of the block to set up the block.
- The 'Event source URL' is a mandatory field pointing to the JSON feed URL providing the event data of the calendar. This can be a relative path to internal pages such as a Drupal "REST export" views, custom Controllers, or an absolute URL pointing to another external event data provider.
-
The 'Advanced settings' provides the capability to add or modify any options of the FullCalendar, which has to be valid JSON/YAML format text. For example, following will set the initial date at 2022-05-01,
-
The 'Advanced Drupal settings' provides support for more advanced Fullcalendar behaviour relating to the dialog, which has to be valid JSON/YAML format text. Available options are as follows:
# The dialog modal type. dialog_type: 'modal' # Additional options to pass through to the Drupal modal. dialog_options: # Disable Drupal's default autoResize feature on all blocks. autoResize: false # Whether to enable integration with jquery_ui_draggable if installed. draggable: false # Options to pass over to jquery_ui_draggable. draggable_options: {} # Whether to enable integration with jquery_ui_resizable if installed. resizable: false # Options to pass over to jquery_ui_resizable. resizable_options: {} # Show event description in dialog window. # If enabled, the description will show in a dialog window upon clicking the event. description_popup: false # Event description field name to use for the popup dialog. description_field: 'des' # Assume the event titles might contain valid HTML, so attempt to strip out the tags. html_title: false # Event field name to optionally signify when or when not to sanitize an event title. raw_title_field: 'rawTitle' # Event background color setting. event_background: # The name of the field used to distinguish event color. It could be the content type. field_name: field_event_type # The field value and the according color code, or the content type id. color_map: - '5 #ff0000' - '6 #ff0000' - '7 #0000ff'
-
After saving the configurations, you might need to clear the cache to apply the changes, but it's typically not necessary.
-
(Optional) If you are using a Drupal view as the data source and you want to load events via AJAX, you need to expose the view filter as the start day and end day and then name them accordingly. The view URL looks like this, /event-feed?start=2023-01-01T00%3A00%3A00-05%3A00&end=2023-02-12T00%3A00%3A00-05%3A00 You can get an example from https://www.drupal.org/project/fullcalendar_block/issues/3345963