Profile image 

The profile card and the public profile detail render the profile image through the responsive image partial of EXT:academic_base, Academic/Image.html. The card is the one of the list, card, selected profiles and selected contracts content elements, and of the contacts content element of EXT:academic_contacts4pages. The partial, its arguments and its presets are described in the Templates chapter of EXT:academic_base.

View Preset Crop variant Without an image
Profile card of the card element, Partials/Profile/Item/Image.html card image.card.cropVariant The gender placeholder or the default one, unless both are empty
Profile card of every other element, Partials/Profile/Item/Image.html card image.list.cropVariant The gender placeholder or the default one, unless both are empty
Public profile, Partials/Profile/PublicProfile/ProfileImage.html detail, with the title and the names as alternative text image.detail.cropVariant No image

When a content element limits the shown fields and leaves out the profile image, the card shows neither the image nor the placeholder.

The crop variant of a view 

Three site settings of the set fgtclb/academic-persons, also declared as TypoScript constants with the same default, choose the crop variant a view renders:

plugin.tx_academicpersons.image.list.cropVariant
Type
string
Default
default

The profile cards of the list, list and detail, selected profiles and selected contracts elements, and of the contacts of a page.

plugin.tx_academicpersons.image.card.cropVariant
Type
string
Default
default

The profile cards of the card element.

plugin.tx_academicpersons.image.detail.cropVariant
Type
string
Default
default

The profile image of the public profile.

The profile image offers the variants default, square and portrait, see The crop variants of the profile image. A project that defines crop variants of its own sets their names here. An empty value renders default.

An image is shown uncropped, at its own ratio, when it has no crop stored for the variant a view requests, whatever crop it has for default. That is the case for a name the image does not define, which is therefore not an error, and for every image nobody opened and saved in the backend form since the variants were added. It is also the case for every image uploaded through the frontend editor of EXT:academic_persons_edit, which stores no crop area. A site that sets square or portrait shows those images uncropped until an editor crops them in the backend.

TypoScript constants
plugin.tx_academicpersons.image.card.cropVariant = square
Copied!

All content elements share one settings array, so the card template tells the item which view it renders: Templates/Profile/Card.html passes imageView: 'card' to Partials/Profile/List/Items.html, which hands it on to Partials/Profile/Item.html and from there, with all its arguments, to Partials/Profile/Item/Image.html. Every other caller leaves it out and gets the list crop variant.

A project copy of Templates/Profile/Card.html or Partials/Profile/List/Items.html, and a copy of Partials/Profile/Item.html that renders the image with arguments of its own, has to hand imageView on. Without it the card renders the list crop variant.

The placeholder 

plugin.tx_academicpersons.image.placeholder.default
Type
string
Default
EXT:academic_persons/Resources/Public/Images/ProfilePlaceholder.svg

The placeholder of a profile without an image, a neutral silhouette by default. An empty value switches it off: a card of a profile without an image then shows no image, unless a gender placeholder applies.

plugin.tx_academicpersons.image.placeholder.mr
Type
string
Default
empty

The placeholder of a profile of the gender Mr. without an image. placeholder.ms and placeholder.diverse do the same for the other two genders. An empty value, and a profile without a gender, use the default placeholder.

The four are TypoScript constants and site settings of the set fgtclb/academic-persons, with the same defaults. The generic one is called default rather than placeholder itself because a site setting either holds a value or has children, never both.

A project that adds a gender value of its own to the profile maps a placeholder for it into the plugin settings itself, since only the three shipped values are settings. The contacts of a page of EXT:academic_contacts4pages have plugin settings of their own and need the same line:

TypoScript setup
plugin.tx_academicpersons.settings.image.placeholder.other = EXT:my_sitepackage/Resources/Public/Images/Person.svg
plugin.tx_academiccontacts4pages.settings.image.placeholder.other = EXT:my_sitepackage/Resources/Public/Images/Person.svg
Copied!
  • An EXT: path to a public file of another extension, usually the site package, replaces the placeholder. A combined file identifier such as 1:/user_upload/placeholder.svg is not supported.
  • A path that does not resolve fails the rendering, so a missing file is noticed when the site package is deployed rather than hidden.
  • The placeholder has an empty alternative text. It shows nobody, and the name is the heading of the same card.
TypoScript constants
plugin.tx_academicpersons.image.placeholder {
  default = EXT:my_sitepackage/Resources/Public/Images/Person.svg
  ms = EXT:my_sitepackage/Resources/Public/Images/PersonMs.svg
}
Copied!

Changing the image markup 

The plugin view registers EXT:academic_base/Resources/Private/Partials/ with the partial root path key -1, below its own partials at 0 and the project path at 1. A project changes the markup, the breakpoints and the widths of every profile image by placing its own Academic/Image.html in the partial root path it configures through plugin.tx_academicpersons.view.partialRootPath - there is no need to override Profile/Item.html for it.

The widths are deliberately not a setting. Each preset is a section of that partial, Preset-card and Preset-detail for the profile images, and a project that overrides the partial changes them for every academic extension at once.

The card renders it through Partials/Profile/Item/Image.html, which is where the preset, the crop variant, the placeholder and the classes are decided. Overriding that one file changes them for the card alone, without touching the shared partial and without copying the item - see Item and list partials.