Important: Profile names leave out empty parts
Description
The templates composed the name of a profile from its title, first name, middle name and last name with a space between every two parts, also when a part was empty. A profile without a middle name was rendered with two spaces between first and last name, and on the detail page a profile without a title started with a space.
The name now leaves out the parts a profile does not have, together with their space:
- The heading of a profile in
Resources/Private/Partials/Profile/Item.html, which the Persons List, Persons List and Detail, Profile Card, Profiles: Selected Profiles and Profiles: Selected Contracts plugins render for every profile, and the contacts plugin ofEXT:as well. It has no title, as before.academic_ contacts4pages - The heading of
Resources/Private/Templates/Profile/Detail.htmland thealttext of the profile image on the detail page.
A profile with all four parts is rendered as before.
Impact
The page looks the same, browsers collapse the spaces. The markup changes:
the heading text and the
alt
attribute hold the name with single
spaces and without a leading space. Code or tests that match the rendered
markup may have to be adjusted.
Affected Installations
Every installation that renders profiles without a title or a middle name. Nothing has to be done on update.
A site that overrides one of the two files keeps the old composition. To take
over the change, use these expressions in the copy. In
Partials/, the
header
argument of both
headings:
header: '{profile.firstName}{f:if(condition: profile.middleName, then: \' {profile.middleName}\')} {profile.lastName}',
In Templates/, the
header
argument and the
alt
attribute of the image:
header: '{f:if(condition: profile.title, then: \'{profile.title} \')}{profile.firstName}{f:if(condition: profile.middleName, then: \' {profile.middleName}\')} {profile.lastName}',
alt="{f:if(condition: profile.title, then: '{profile.title} ')}{profile.firstName}{f:if(condition: profile.middleName, then: ' {profile.middleName}')} {profile.lastName}"