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.5.0 (May 11, 2026)

### Added
- **Columns** field on the content plugin and site module — comma-separated list of columns to show in list view (e.g. `time,name,location,address,service_body`). Omit a name to hide that column. Can be overridden per shortcode on the content plugin via `columns="…"`.

## 0.4.0 (May 10, 2026)

### Added
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ By default, the plugin reads its settings (server URL, service body IDs, etc.) f
{crumb server="https://bmlt.example.org/main_server" service_body="42" view="map"}
```

Recognised shortcode args: `server`, `service_body`, `format_ids`, `view` (`list`/`map`), `geolocation` (`true`/`false`), `geolocation_radius`, `update_url`.
Recognised shortcode args: `server`, `service_body`, `format_ids`, `view` (`list`/`map`), `geolocation` (`true`/`false`), `geolocation_radius`, `update_url`, `columns`.

### In a module position (module)

Expand All @@ -57,6 +57,7 @@ Both the plugin and the module expose the same fields:
| **CSS Template** | `Full Width` or `Full Width (Force Viewport)` for breaking out of narrow content areas. |
| **Base Path for Pretty URLs** | e.g. `meetings` → `/meetings/monday-night-meeting-42` (History API routing). Empty = hash-based routing. |
| **Update Meeting URL** | Optional. URL template for the "Update Meeting Info" link on the meeting detail panel. Tokens: `{meeting_id}`, `{meeting_name}`, `{server_url}`, `{return_url}`. Works with bmlt-workflow, hosted forms, or `mailto:` URLs. |
| **Columns** | Optional. Comma-separated list of columns to show in list view (e.g. `time,name,location,address,service_body`). Omit a name to hide that column. Empty = widget default. |
| **Widget Configuration (JSON)** | Advanced. JSON for `CrumbWidgetConfig`. See the [widget docs](https://crumb.bmlt.app/) for the full schema (`darkMode`, `geolocation`, `nowOffset`, `columns`, etc.). |

## Local development
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 @@ -34,5 +34,8 @@ MOD_CRUMB_FIELD_BASE_PATH_DESC="Optional. The path where the widget lives (e.g.
MOD_CRUMB_FIELD_UPDATE_URL_LABEL="Update Meeting URL"
MOD_CRUMB_FIELD_UPDATE_URL_DESC="Optional. URL template for the &quot;Update Meeting Info&quot; link shown at the bottom of the meeting detail panel. Supported tokens (URL-encoded on substitution): <code>{meeting_id}</code>, <code>{meeting_name}</code>, <code>{server_url}</code>, <code>{return_url}</code>. Works with bmlt-workflow, any hosted form, or a <code>mailto:</code> URL. Leave empty to hide the link."

MOD_CRUMB_FIELD_COLUMNS_LABEL="Columns"
MOD_CRUMB_FIELD_COLUMNS_DESC="Optional. Comma-separated list of columns to show in list view (e.g. <code>time,name,location,address,service_body</code>). Omit a name to hide that column. Leave empty to use the widget default."

MOD_CRUMB_FIELD_WIDGET_CONFIG_LABEL="Widget Configuration (JSON)"
MOD_CRUMB_FIELD_WIDGET_CONFIG_DESC="Optional. CrumbWidgetConfig in JSON format. See https://crumb.bmlt.app/ for available options."
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.4.0</version>
<version>0.5.0</version>
<description>MOD_CRUMB_XML_DESCRIPTION</description>
<namespace path="src">BmltEnabled\Module\Crumb\Site</namespace>

Expand Down Expand Up @@ -101,6 +101,15 @@
filter="raw"
default=""
/>
<field
name="columns"
type="text"
label="MOD_CRUMB_FIELD_COLUMNS_LABEL"
description="MOD_CRUMB_FIELD_COLUMNS_DESC"
hint="time,name,location,address,service_body"
filter="string"
default=""
/>
</fieldset>
<fieldset name="advanced">
<field
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 @@ -36,6 +36,7 @@ public function getSettings(Registry $params): array
'base_path' => (string) $params->get('base_path', ''),
'geolocation_radius' => (string) $params->get('geolocation_radius', ''),
'update_url' => (string) $params->get('update_url', ''),
'columns' => (string) $params->get('columns', ''),
'widget_config' => (string) $params->get('widget_config', ''),
];
}
Expand All @@ -61,6 +62,7 @@ public function render(array $settings): string
$basePath = trim((string) ($settings['base_path'] ?? ''), '/');
$template = (string) ($settings['css_template'] ?? '');
$updateUrl = trim((string) ($settings['update_url'] ?? ''));
$columns = trim((string) ($settings['columns'] ?? ''));
$widgetConf = trim((string) ($settings['widget_config'] ?? ''));

$attrs = [
Expand All @@ -82,6 +84,9 @@ public function render(array $settings): string
if ($updateUrl !== '') {
$attrs['data-update-url'] = $updateUrl;
}
if ($columns !== '') {
$attrs['data-columns'] = $columns;
}

$attrString = '';
foreach ($attrs as $k => $v) {
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.4.0</version>
<version>0.5.0</version>
<description>PLG_CONTENT_CRUMB_XML_DESCRIPTION</description>
<namespace path="src">BmltEnabled\Plugin\Content\Crumb</namespace>

Expand Down Expand Up @@ -100,6 +100,15 @@
filter="raw"
default=""
/>
<field
name="columns"
type="text"
label="PLG_CONTENT_CRUMB_FIELD_COLUMNS_LABEL"
description="PLG_CONTENT_CRUMB_FIELD_COLUMNS_DESC"
hint="time,name,location,address,service_body"
filter="string"
default=""
/>
</fieldset>
<fieldset name="advanced">
<field
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 @@ -34,5 +34,8 @@ PLG_CONTENT_CRUMB_FIELD_BASE_PATH_DESC="Optional. The path where the widget live
PLG_CONTENT_CRUMB_FIELD_UPDATE_URL_LABEL="Update Meeting URL"
PLG_CONTENT_CRUMB_FIELD_UPDATE_URL_DESC="Optional. URL template for the &quot;Update Meeting Info&quot; link shown at the bottom of the meeting detail panel. Supported tokens (URL-encoded on substitution): <code>{meeting_id}</code>, <code>{meeting_name}</code>, <code>{server_url}</code>, <code>{return_url}</code>. Works with bmlt-workflow, any hosted form, or a <code>mailto:</code> URL. Leave empty to hide the link. Can be overridden per shortcode via update_url=&quot;…&quot;."

PLG_CONTENT_CRUMB_FIELD_COLUMNS_LABEL="Columns"
PLG_CONTENT_CRUMB_FIELD_COLUMNS_DESC="Optional. Comma-separated list of columns to show in list view (e.g. <code>time,name,location,address,service_body</code>). Omit a name to hide that column. Leave empty to use the widget default. Can be overridden per shortcode via columns=&quot;…&quot;."

PLG_CONTENT_CRUMB_FIELD_WIDGET_CONFIG_LABEL="Widget Configuration (JSON)"
PLG_CONTENT_CRUMB_FIELD_WIDGET_CONFIG_DESC="Optional. CrumbWidgetConfig in JSON format. See https://crumb.bmlt.app/ for available options."
1 change: 1 addition & 0 deletions packages/plugin/src/Extension/Crumb.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public function onContentPrepare(string $context, &$article = null, &$params = n
'base_path' => (string) $this->params->get('base_path', ''),
'geolocation_radius' => (string) $this->params->get('geolocation_radius', ''),
'update_url' => (string) $this->params->get('update_url', ''),
'columns' => (string) $this->params->get('columns', ''),
'widget_config' => (string) $this->params->get('widget_config', ''),
];

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 @@ -45,6 +45,7 @@ public static function render(array $settings, array $overrides = []): string
$basePath = trim((string) ($settings['base_path'] ?? ''), '/');
$template = (string) ($settings['css_template'] ?? '');
$updateUrl = trim((string) ($overrides['update_url'] ?? $settings['update_url'] ?? ''));
$columns = trim((string) ($overrides['columns'] ?? $settings['columns'] ?? ''));
$widgetConf = trim((string) ($settings['widget_config'] ?? ''));

$attrs = [
Expand All @@ -66,6 +67,9 @@ public static function render(array $settings, array $overrides = []): string
if ($updateUrl !== '') {
$attrs['data-update-url'] = $updateUrl;
}
if ($columns !== '') {
$attrs['data-columns'] = $columns;
}
if (isset($overrides['geolocation']) && $overrides['geolocation'] !== null) {
$geo = filter_var($overrides['geolocation'], FILTER_VALIDATE_BOOLEAN);
$attrs['data-geolocation'] = $geo ? 'true' : 'false';
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.4.0</version>
<version>0.5.0</version>
<url>https://github.com/bmlt-enabled/crumb-joomla</url>
<packager>bmlt-enabled</packager>
<packagerurl>https://github.com/bmlt-enabled</packagerurl>
Expand Down
43 changes: 43 additions & 0 deletions tests/Unit/CrumbRendererTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,49 @@ public function testEmptyFormatIdsOverrideOmitsAttribute(): void
$this->assertStringNotContainsString('data-format-ids', $output);
}

public function testColumnsAttributeEmittedFromSettings(): void
{
$output = CrumbRenderer::render([
'server' => 'https://x/main_server',
'columns' => 'time,name,location,address,service_body',
]);
$this->assertStringContainsString('data-columns="time,name,location,address,service_body"', $output);
}

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

public function testColumnsOverrideBeatsSavedSetting(): void
{
$output = CrumbRenderer::render(
['server' => 'https://x/main_server', 'columns' => 'time,name'],
['columns' => 'name,location']
);
$this->assertStringContainsString('data-columns="name,location"', $output);
$this->assertStringNotContainsString('data-columns="time,name"', $output);
}

public function testColumnsOverrideTrimmed(): void
{
$output = CrumbRenderer::render(
['server' => 'https://x/main_server'],
['columns' => ' time,name ']
);
$this->assertStringContainsString('data-columns="time,name"', $output);
}

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

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