Feature: The study plan script can be switched off
Description
The study plan content element registers its script from inside its own
template, with
<f:. An installation that brings a script
of its own therefore had to override the whole template - and then shipped a
copy of it that stopped following the original.
The script is switchable now, per site, without touching the template:
| Setting | Default | Off means |
|---|---|---|
plugin. |
true
| The page does not load
@fgtclb/. |
It is declared by the site set
fgtclb/, so every site that renders
the element can set it:
plugin.tx_academicstudyplan.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_academicstudyplan.assets.js = 0
Impact
Nothing changes for an installation that configures nothing: the script is loaded exactly as before, and only a page that carries the element loads it. The element brings no stylesheet, see Breaking: The study plan ships no stylesheet.
The markup is unchanged either way. Switching the script off does not reduce the element to what works without JavaScript - the filter, the semester accordion and the module dialogs need a script, and an installation that switches the shipped one off brings its own.
Affected Installations
Every installation that renders the study plan content element. The defaults keep the script exactly as it was, so switching nothing off needs no action here.
An installation that overrode Academic only to leave out
the script can drop that override and set the switch instead -
which also puts it back on the shipped script, with the keyboard handling and
the dialog behaviour it has gained since the copy was taken.
Two cases the switch does not reach, both silent:
- An installation that keeps its own copy of the template. The copy is
rendered as it is, so its own
f:line keeps loading unconditionally until it is wrapped in the sameasset f:.if - A content object written by hand rather than copied from
setup.. It assigns notyposcript settings.block, so the condition is false and the element loads no script. Copy the block, or assign the key.assets
Note
Switching the script off is not the whole story for an installation that
then brings its own: the filter list item the script clones is rendered
hidden
, and a script of your own has to take that attribute off the
items it builds. See
Important: The study plan filter template item is hidden.
Note
The switch is declared twice, once as a site setting and once as a TypoScript constant, with the same default. A site that includes the site set and the static template reads the constants after the site settings, so the constant wins there - one mechanism per site, as Do not combine both says.