Feature: Study plan partials and a markup contract
Description
The study plan content element rendered every part of itself from one template, and its script found those parts by class name. An installation that wanted a different filter, a different module or a module that opens its dialog when it is clicked anywhere had to replace the whole template - and with it the class names the script looks for, so it had to fork the script as well.
The template is split into four partials now:
| Partial | Renders |
|---|---|
Study | The category filter. |
Study | One semester column, with its header and its modules. |
Study | One module, with its dialog trigger. |
Study | The dialog of one module. |
Each of them receives exactly the variables it renders, and each can be
replaced on its own through
tt_ or the constant
plugin..
The script no longer looks for class names. Every part it drives carries a
data- attribute - the filter and the item it clones, the
semester and its header, the module, the dialog and the control that opens it -
and an override that keeps those attributes keeps the whole interaction,
whatever it does to the elements and the classes around them. The attributes,
the element each belongs on and the arguments of each partial are documented in
Templates.
Two things the contract makes possible without a fork:
data-may sit on the module element itself, which makes the whole module open its dialog. The script pairs it with the dialog of that very module. It is not the shipped markup, and Templates says why.study- plan- dialog- trigger - The category filter can be collapsed behind a toggle button, with the new
site setting
plugin.(tx_ academicstudyplan. filter. collapsible falseby default). The toggle carriesaria-andexpanded aria-and works by keyboard. See Collapse the category filter.controls
Impact
The default behaviour is unchanged. An installation that configures nothing and overrides nothing renders the same text and behaves the same by mouse and by keyboard. The classes of the markup changed in the same version, see Breaking: Study plan templates carry speaking classes.
Affected Installations
Every installation that renders the study plan content element. None of them has anything to do on update.
An installation that forked Academic or the script can
move onto the partials and the attributes instead, and stop carrying the copy.
Markup that identifies its parts only by the class names of 2.x keeps working
for the whole 3.x line, see
Deprecation: The study plan class selectors.