Feature: Crop variant and placeholder of a profile image
Description
Which crop of a profile image a view renders, and which placeholder stands in for a profile without an image, are site settings now. Until now a project had to copy the item and the detail templates to change either of them.
| Setting | Default | Read by |
|---|---|---|
plugin. | default | The list, list and detail, selected profiles and selected contracts elements, and the contacts of a page |
plugin. | default | The card element |
plugin. | default | The public profile |
plugin.,
plugin. and
plugin. | (empty) | A profile of that gender without an image |
square and portrait are the other crop variants the profile image offers,
see The crop variants of the profile image. An empty value renders default. An
image without a crop stored for the requested variant is shown uncropped, and
so is every image for a name it does not define.
A gender placeholder wins over
plugin. for the profiles of its
gender. An empty one, and a profile without a gender, fall back to the default
placeholder. Every placeholder is an EXT: path to a public file, and a path
that does not resolve fails the rendering.
plugin.tx_academicpersons.image {
card.cropVariant = square
placeholder.ms = EXT:my_sitepackage/Resources/Public/Images/PersonMs.svg
}
The widths are not a setting: they come from the presets of the image partial of EXT:academic_base, see Changing the image markup.
Impact
With the defaults every view renders what it rendered before.
A site that sets square or portrait shows an image uncropped, at its own
ratio, until an editor crops it for that variant in the backend. That includes
every image uploaded through the frontend editor of
fgtclb/academic-persons-edit
, which stores no crop area.
All content elements of this extension share one settings array, so the card
template tells the item which view it renders: it passes image
to Partials/, which hands it on to
Partials/ and from there to the item image. A project
copy of any of the three that predates this change does not hand it on, and
its card reads the list crop variant:
- A copy of
Templates/addsProfile/ Card. html imageto the arguments ofView: 'card' Profile/.List/ Items - A copy of
Partials/addsProfile/ List/ Items. html imageto bothView: image View <f:calls.render partial="Profile/ Item"> - A copy of
Partials/that rendersProfile/ Item. html Profile/with arguments of its own addsItem/ Image imageto them.View: image View
A site that leaves the card crop variant unset needs none of that.
The contacts of a page of fgtclb/academic-contacts4pages follow the list crop variant and the gender placeholders, as they already followed the default placeholder.