faithcatholic/masstimes_widget

There is no license information available for the latest version (v1.0.0) of this package.

A custom Drupal module embedding a full-screen interactive map and sidebar list of Catholic parishes, powered by the MassTimes Trust database & API.

Installs: 1

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

Language:CSS

Type:drupal-module

v1.0.0 2025-07-21 18:32 UTC

This package is auto-updated.

Last update: 2025-07-22 11:40:55 UTC


README

A custom Drupal module embedding a full-screen interactive map and sidebar list of Catholic parishes, powered by the MassTimes Trust database & API.

🚀 Features

  • Auto-detect your current location via browser geolocation
  • Fallback to configurable default latitude/longitude if geolocation is unavailable or denied
  • Search by ZIP code or City, State (US-only autocomplete via Nominatim)
  • Interactive map (Leaflet) with parish markers & popups
  • Scrollable sidebar of parish details, synchronized with map clicks
  • Mobile-friendly responsive layout

⚙️ Configuration

  1. In the Block layout screen, place the MassTimes Map Fullscreen Block.

  2. Under Default latitude and Default longitude, enter your preferred fallback coordinates.
    If the user declines geolocation or no URL query parameters are present, the map will center on these values.

    Default Lat/Long Settings

  3. When viewing the page, the map will render full-width with the sidebar alongside:

    Full-Screen Map & Sidebar

🔧 Installation

  1. Clone or download into web/modules/custom/mass_times_widget.
  2. Ensure dependencies in mass_times_widget.info.yml are met (e.g. leaflet module).
  3. Run drush en mass_times_widget -y (or enable via the UI).
  4. Clear caches: drush cr.

🧩 How It Works

  • Block plugin (MassTimesMapBlock) fetches user coordinates from URL (?lat=…&long=…) or falls back to the values configured on the block.
  • It calls the MassTimes API (https://apiv4.updateparishdata.org/Churchs/) to retrieve nearby churches, sorts them by distance, and builds a GeoJSON feature collection.
  • The Twig template (masstimes-map.html.twig) renders the map container and sidebar.
  • The accompanying JS behavior initializes the Leaflet map, adds parish markers, and ties marker clicks to opening the corresponding <details> in the sidebar.
  • The module ships with CSS to ensure a full-width layout, responsive sidebar, and styled parish cards.

🙏 Credits

This module leverages:

  • Peter Wagner & the MassTimes Trust (masstimes.org) for their comprehensive global database of Catholic parishes and worship times.
  • Leaflet for interactive maps.
  • Nominatim (OpenStreetMap) for address/ZIP autocomplete.

📝 License

Licensed under GPL-2.0-or-later. All church data © Mass Times Trust; used with permission.