Feature: The script of the partner map can be switched off 

Description 

The partial Partner/Map.html registers the module @fgtclb/academic-partners/frontend/map.js and the stylesheets of the map libraries it imports, Leaflet and Leaflet.markercluster. An installation that draws the map with a script of its own had to override the partial to leave them out.

The module and the stylesheets of the libraries are switchable now, together, per site:

Site setting and constant Default
plugin.tx_academicpartners.assets.js true

It is declared by the site set fgtclb/academic-partners-map, next to the other settings of the map:

config/sites/my-site/settings.yaml
plugin.tx_academicpartners.assets.js: false
Copied!

An installation that configures its frontend through sys_template records sets the TypoScript constant of the very same name, in Constants:

Constants of the root sys_template record
plugin.tx_academicpartners.assets.js = 0
Copied!

Every academic extension that loads a script has this switch, named assets.js below its own plugin namespace and switched on by default, after the switch of the study plan content element.

Impact 

Nothing changes for an installation that configures nothing: the map loads its script and the stylesheets of the libraries exactly as before.

Switched off, the page loads neither, and the markup is unchanged: the map element with its settings as data attributes, and the hidden list of the partners. The map stays empty until a script of the site draws it from them, see Load the script or bring your own.

The partial takes the switch as the new argument assets . The Partner Map content element passes it, and the data processor partner-data adds it to the page of the page type Academic partner as {mapAssets} , next to {mapSettings} :

<f:render partial="Partner/Map" arguments="{partner: partner, map: mapSettings, assets: mapAssets}" />
Copied!

A page template that renders the partial without the argument loads the script whatever the setting says, as it did before. A project that overrides Partials/Partner/Map.html keeps whatever its copy loads.