Feature: The script of the partner map can be switched off
Description
The partial Partner/ registers the module
@fgtclb/ 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. |
true
|
It is declared by the site set fgtclb/, next to the other
settings of the map:
plugin.tx_academicpartners.assets.js: false
An installation that configures its frontend through
sys_
records sets the TypoScript constant of the very same name, in
Constants:
plugin.tx_academicpartners.assets.js = 0
Every academic extension that loads a script has this switch, named
assets. 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- adds it to the page of the page type Academic
partner as
{map, next to
{map:
<f:render partial="Partner/Map" arguments="{partner: partner, map: mapSettings, assets: mapAssets}" />
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/ keeps whatever its copy loads.