No description
  • PHP 59.3%
  • Twig 29.2%
  • JavaScript 11.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Christian Säum 5604fbb625
All checks were successful
CI / php (push) Successful in 56s
CI / sicherheit (push) Successful in 16s
CI / build-release (push) Successful in 19s
Merge pull request 'feat(locations_pages): Kategorie aus URL-Parameter' (#5) from feature/locations-pages-url-filter into main
2026-11-25 09:46:10 +00:00
.forgejo/workflows ci(forgejo): add ci workflow and release package rules 2026-11-18 08:55:56 +01:00
.github ci(github): add dependabot and release check workflow 2026-11-18 12:35:30 +01:00
.idea chore(bundle): add bundle skeleton 2026-11-17 20:07:34 +01:00
assets feat(locations_pages): map block with pins from pages and a category filter 2026-11-25 10:23:50 +01:00
config/templates/blocks feat(locations_pages): take the category from a URL parameter 2026-11-25 10:43:50 +01:00
doc/css-api/blocks feat(locations_pages): take the category from a URL parameter 2026-11-25 10:43:50 +01:00
examples/pages feat(locations): add templates, dispatcher entry and block lists 2026-11-17 22:16:24 +01:00
src feat(columns): add columns block with nested block types 2026-11-17 20:14:31 +01:00
templates feat(locations_pages): take the category from a URL parameter 2026-11-25 10:43:50 +01:00
templates-override/components feat(locations_pages): map block with pins from pages and a category filter 2026-11-25 10:23:50 +01:00
tests feat(locations_pages): take the category from a URL parameter 2026-11-25 10:43:50 +01:00
translations feat(locations_pages): take the category from a URL parameter 2026-11-25 10:43:50 +01:00
.gitattributes ci(forgejo): add ci workflow and release package rules 2026-11-18 08:55:56 +01:00
.gitignore chore(bundle): add bundle skeleton 2026-11-17 20:07:34 +01:00
.php-cs-fixer.dist.php test(columns): add contract tests and lint configuration 2026-11-17 20:26:26 +01:00
AGENTS.md chore(bundle): add bundle skeleton 2026-11-17 20:07:34 +01:00
CLAUDE.md chore(bundle): add bundle skeleton 2026-11-17 20:07:34 +01:00
composer.json fix(ci): resolve dependencies without github api and dev symfony packages 2026-11-18 11:03:05 +01:00
LICENSE chore(bundle): add bundle skeleton 2026-11-17 20:07:34 +01:00
phpstan.neon.dist test(columns): add contract tests and lint configuration 2026-11-17 20:26:26 +01:00
phpunit.xml.dist test(columns): add contract tests and lint configuration 2026-11-17 20:26:26 +01:00
Projekt.md chore(bundle): add bundle skeleton 2026-11-17 20:07:34 +01:00
README.md feat(locations_pages): take the category from a URL parameter 2026-11-25 10:43:50 +01:00

WSC Sulu Bundle – Tailwind Theme Extra Blocks

Additional content blocks for itech-world/sulu-tailwind-theme-bundle (Sulu CMS 3.x). This is not a fork: the original bundle stays untouched, this bundle depends on it and registers extra block types next to the original ones via sulu_admin.templates.block.directories.

Blocks:

Block What it does
columns 2, 3 or 4 columns side by side, each column takes any other block
locations One map with several pins (the theme's location block has one)
locations_pages One map whose pins come from pages (smart content): popup links to the page, optional filter by category

Requirements

  • Sulu CMS >= 3.0
  • PHP >= 8.2
  • Tailwind CSS >= 4.0, Webpack Encore, Doctrine ORM >= 3.0
  • itech-world/sulu-tailwind-theme-bundle (branch feat/3.0.0 until 3.0.0 is released)

Installation

  1. Add the VCS repository of the theme bundle to your project composer.json (needed only until 3.0.0 is released) and require this bundle:

    composer require wsc/sulubundle-tailwindthemeextrablocks
    
  2. Register the bundle in config/bundles.php, after the theme bundle:

    Wsc\SuluBundleTailwindThemeExtraBlocks\WscSuluBundleTailwindThemeExtraBlocksBundle::class => ['all' => true],
    
  3. Let Tailwind scan the templates of this bundle, in your main CSS file (next to the @source line of the theme bundle):

    @source "../../vendor/wsc/sulubundle-tailwindthemeextrablocks/templates";
    
  4. Only for the locations block: add the JavaScript package of this bundle (the Stimulus controller of the map) to your package.json, next to the theme package, and enable it in assets/controllers.json:

    "@wsc/sulubundle-tailwindthemeextrablocks": "file:vendor/wsc/sulubundle-tailwindthemeextrablocks/assets"
    
    "@wsc/sulubundle-tailwindthemeextrablocks": {
        "locations_map": { "enabled": true, "fetch": "lazy" }
    }
    

    It builds on the map controller and leaflet of the theme bundle, which are already installed.

  5. Build the assets and clear the cache:

    npm run build
    bin/console cache:clear
    
  6. Offer the blocks on your pages (see "Using the blocks in the Default page").

Columns block

A layout container with 2, 3 or 4 columns (stacked on mobile). Every column takes any global block of the theme bundle, except the columns block itself: a column inside a column is deliberately not offered.

Limits worth knowing:

  • The block types a column offers are listed in config/templates/blocks/columns.xml. When the theme bundle gets a new block, it has to be added there.
  • The block shares the theme bundle's settings fragments through a relative xi:include into vendor/itech-world/. With a composer path repository use "options": {"symlink": false}, otherwise the path does not resolve.

Locations block

One map with several pins. Each pin is a Sulu location field; the map shows all of them and fits them into view. Layout: map only, or the map with a list of the pins next to it. Map height: small, medium, large.

  • Settings come from the theme. Tile provider, custom tile URL, scroll-zoom mode, marker image/icon and the consent handling are the ones of Components > Maps in the theme settings; there is nothing to configure twice.
  • The Stimulus controller wsc-locations-map extends the map controller of the theme bundle. It depends on methods that are not a public API of the theme; LocationsMapControllerContractTest fails when they disappear.
  • The four tile presets are a copy of the theme's table; LocationsTemplateContractTest fails when the theme changes them.
  • Can be placed inside a column of the columns block.

Using the blocks in the Default page

The page template "Default page" of the theme bundle lists its blocks in the theme bundle, which this bundle cannot extend. Copy the ready-made template into your project once:

mkdir -p config/templates/pages
cp vendor/wsc/sulubundle-tailwindthemeextrablocks/examples/pages/iw_theme_default.xml config/templates/pages/
bin/adminconsole cache:clear

A template of the project wins over the one of the theme bundle (same key iw_theme_default), so "Default page" now offers Columns next to all other blocks, plus Locations (multiple pins). For your own page templates add <type ref="columns"/>, <type ref="locations"/> and <type ref="locations_pages"/> to their block list.

Block locations_pages

Every selected page that has a Sulu location field named location gets a pin. The popup links to the page, the categories of the page (Excerpt tab) become buttons in the map that show only the pins of one category. The filter is built with JavaScript and ships with an inline look, the classes iw-locations-map__filter and iw-locations-map__filter-button are hooks for your own CSS.

To drive the map from a filter outside the block (e.g. category links above a member list), set URL parameter for the category (Settings), e.g. branche. The map then shows only the pins whose page has the category id from ?branche=<id>; an unknown value shows all pins. The filter bar in the map is switched off in that case, so there is one filter only.

Why not automatically? Sulu builds the admin form of a page from the template and its JSON schema. When a bundle registers a second file with the key of an existing template, the two disagree and the form does not load. When the theme bundle gets a new block or changes its default page, update your copy.

Structure

Directory Content
src/ Bundle class
config/templates/blocks/ Block definitions (Sulu XML), registered with the admin
templates/ Twig templates of the blocks
examples/ Ready-to-copy page template with the columns block
templates-override/ Replaces the block dispatcher of the theme bundle so it also renders the blocks of this bundle
translations/ Admin translations (FR, EN, DE)
assets/ Frontend assets: Stimulus controller of the locations map
doc/css-api/blocks/ CSS API documentation per block
tests/ PHPUnit tests

License

MIT, see LICENSE.