Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/).

## [Unreleased]

## 0.2.0 (May 5, 2026)

### Added
- **Format IDs** field on the content plugin and site module — single ID or comma-separated list of BMLT format IDs to lock the widget to. Can be overridden per shortcode via `format_ids="17,54"`.

## 0.1.0 (April 29, 2026)

Initial release. Embed the [Crumb](https://crumb.bmlt.app/) BMLT meeting-finder widget in Joomla 4, 5, or 6 sites.
Expand Down
3 changes: 3 additions & 0 deletions packages/module/language/en-GB/mod_crumb.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ MOD_CRUMB_FIELD_SERVER_DESC="Required. The full URL to your BMLT server (e.g. ht
MOD_CRUMB_FIELD_SERVICE_BODY_LABEL="Service Body IDs"
MOD_CRUMB_FIELD_SERVICE_BODY_DESC="Optional. Single ID or comma-separated list. Leave empty to show all meetings. Child service bodies are always included."

MOD_CRUMB_FIELD_FORMAT_IDS_LABEL="Format IDs"
MOD_CRUMB_FIELD_FORMAT_IDS_DESC="Optional. Single ID or comma-separated list of BMLT format IDs to lock the widget to. Leave empty to show all formats."

MOD_CRUMB_FIELD_VIEW_LABEL="Default View"
MOD_CRUMB_FIELD_VIEW_DESC="Optional. Sets the default view when the widget loads."
MOD_CRUMB_FIELD_VIEW_DEFAULT="— Widget Default (list) —"
Expand Down
11 changes: 10 additions & 1 deletion packages/module/mod_crumb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<license>GPL v2 or later</license>
<authorEmail>bmlt-enabled@googlegroups.com</authorEmail>
<authorUrl>https://github.com/bmlt-enabled/crumb-joomla</authorUrl>
<version>0.1.0</version>
<version>0.2.0</version>
<description>MOD_CRUMB_XML_DESCRIPTION</description>
<namespace path="src">BmltEnabled\Module\Crumb\Site</namespace>

Expand Down Expand Up @@ -43,6 +43,15 @@
filter="string"
default=""
/>
<field
name="format_ids"
type="text"
label="MOD_CRUMB_FIELD_FORMAT_IDS_LABEL"
description="MOD_CRUMB_FIELD_FORMAT_IDS_DESC"
hint="17 or 17,54,78"
filter="string"
default=""
/>
<field
name="view"
type="list"
Expand Down
5 changes: 5 additions & 0 deletions packages/module/src/Helper/CrumbHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public function getSettings(Registry $params): array
return [
'server' => trim((string) $params->get('server', '')),
'service_body' => (string) $params->get('service_body', ''),
'format_ids' => (string) $params->get('format_ids', ''),
'view' => (string) $params->get('view', ''),
'css_template' => (string) $params->get('css_template', ''),
'base_path' => (string) $params->get('base_path', ''),
Expand All @@ -52,6 +53,7 @@ public function render(array $settings): string
}

$serviceBody = $settings['service_body'] ?? '';
$formatIds = $settings['format_ids'] ?? '';
$viewRaw = $settings['view'] ?? '';
$view = \in_array($viewRaw, self::ALLOWED_VIEWS, true) ? $viewRaw : '';
$basePath = trim((string) ($settings['base_path'] ?? ''), '/');
Expand All @@ -65,6 +67,9 @@ public function render(array $settings): string
if ($serviceBody !== '') {
$attrs['data-service-body'] = trim((string) $serviceBody);
}
if ($formatIds !== '') {
$attrs['data-format-ids'] = trim((string) $formatIds);
}
if ($view !== '') {
$attrs['data-view'] = $view;
}
Expand Down
11 changes: 10 additions & 1 deletion packages/plugin/crumb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<license>GPL v2 or later</license>
<authorEmail>bmlt-enabled@googlegroups.com</authorEmail>
<authorUrl>https://github.com/bmlt-enabled/crumb-joomla</authorUrl>
<version>0.1.0</version>
<version>0.2.0</version>
<description>PLG_CONTENT_CRUMB_XML_DESCRIPTION</description>
<namespace path="src">BmltEnabled\Plugin\Content\Crumb</namespace>

Expand Down Expand Up @@ -42,6 +42,15 @@
filter="string"
default=""
/>
<field
name="format_ids"
type="text"
label="PLG_CONTENT_CRUMB_FIELD_FORMAT_IDS_LABEL"
description="PLG_CONTENT_CRUMB_FIELD_FORMAT_IDS_DESC"
hint="17 or 17,54,78"
filter="string"
default=""
/>
<field
name="view"
type="list"
Expand Down
3 changes: 3 additions & 0 deletions packages/plugin/language/en-GB/plg_content_crumb.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ PLG_CONTENT_CRUMB_FIELD_SERVER_DESC="Required. The full URL to your BMLT server
PLG_CONTENT_CRUMB_FIELD_SERVICE_BODY_LABEL="Service Body IDs"
PLG_CONTENT_CRUMB_FIELD_SERVICE_BODY_DESC="Optional. Single ID or comma-separated list. Leave empty to show all meetings. Child service bodies are always included."

PLG_CONTENT_CRUMB_FIELD_FORMAT_IDS_LABEL="Format IDs"
PLG_CONTENT_CRUMB_FIELD_FORMAT_IDS_DESC="Optional. Single ID or comma-separated list of BMLT format IDs to lock the widget to. Leave empty to show all formats. Can be overridden per shortcode via format_ids=&quot;17,54&quot;."

PLG_CONTENT_CRUMB_FIELD_VIEW_LABEL="Default View"
PLG_CONTENT_CRUMB_FIELD_VIEW_DESC="Optional. Sets the default view when the widget loads. Can be overridden per shortcode and via the ?view= query parameter."
PLG_CONTENT_CRUMB_FIELD_VIEW_DEFAULT="— Widget Default (list) —"
Expand Down
1 change: 1 addition & 0 deletions packages/plugin/src/Extension/Crumb.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public function onContentPrepare(string $context, &$article = null, &$params = n
$settings = [
'server' => (string) $this->params->get('server', ''),
'service_body' => (string) $this->params->get('service_body', ''),
'format_ids' => (string) $this->params->get('format_ids', ''),
'view' => (string) $this->params->get('view', ''),
'css_template' => (string) $this->params->get('css_template', ''),
'base_path' => (string) $this->params->get('base_path', ''),
Expand Down
4 changes: 4 additions & 0 deletions packages/plugin/src/Helper/CrumbRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public static function render(array $settings, array $overrides = []): string
}

$serviceBody = $overrides['service_body'] ?? $settings['service_body'] ?? '';
$formatIds = $overrides['format_ids'] ?? $settings['format_ids'] ?? '';
$viewRaw = $overrides['view'] ?? $settings['view'] ?? '';
$view = \in_array($viewRaw, self::ALLOWED_VIEWS, true) ? $viewRaw : '';
$basePath = trim((string) ($settings['base_path'] ?? ''), '/');
Expand All @@ -52,6 +53,9 @@ public static function render(array $settings, array $overrides = []): string
if ($serviceBody !== null && $serviceBody !== '') {
$attrs['data-service-body'] = trim((string) $serviceBody);
}
if ($formatIds !== null && $formatIds !== '') {
$attrs['data-format-ids'] = trim((string) $formatIds);
}
if ($view !== '') {
$attrs['data-view'] = $view;
}
Expand Down
2 changes: 1 addition & 1 deletion pkg_crumb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<authorEmail>bmlt-enabled@googlegroups.com</authorEmail>
<authorUrl>https://github.com/bmlt-enabled/crumb-joomla</authorUrl>
<packagename>crumb</packagename>
<version>0.1.0</version>
<version>0.2.0</version>
<url>https://github.com/bmlt-enabled/crumb-joomla</url>
<packager>bmlt-enabled</packager>
<packagerurl>https://github.com/bmlt-enabled</packagerurl>
Expand Down
34 changes: 34 additions & 0 deletions tests/Unit/CrumbRendererTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,40 @@ public function testServiceBodyAttributeEmittedWhenSet(): void
$this->assertStringContainsString('data-service-body="42,57"', $output);
}

public function testFormatIdsAttributeEmittedFromSettings(): void
{
$output = CrumbRenderer::render([
'server' => 'https://x/main_server',
'format_ids' => '17,54',
]);
$this->assertStringContainsString('data-format-ids="17,54"', $output);
}

public function testFormatIdsAttributeOmittedWhenEmpty(): void
{
$output = CrumbRenderer::render(['server' => 'https://x/main_server']);
$this->assertStringNotContainsString('data-format-ids', $output);
}

public function testFormatIdsOverrideBeatsSavedSetting(): void
{
$output = CrumbRenderer::render(
['server' => 'https://x/main_server', 'format_ids' => '99'],
['format_ids' => '17']
);
$this->assertStringContainsString('data-format-ids="17"', $output);
$this->assertStringNotContainsString('data-format-ids="99"', $output);
}

public function testEmptyFormatIdsOverrideOmitsAttribute(): void
{
$output = CrumbRenderer::render(
['server' => 'https://x/main_server', 'format_ids' => '99'],
['format_ids' => '']
);
$this->assertStringNotContainsString('data-format-ids', $output);
}

public function testInvalidViewIsDroppedNotPassedThrough(): void
{
$output = CrumbRenderer::render([
Expand Down
Loading