Edit Person’s Profiles 

Icon of the profile editing content element
CType

academicpersonsedit_profileediting

Plugin

AcademicPersonsEdit, plugin ProfileEditing, default action ProfileController::listAction() , further actions of ProfileController , DocumentController and ContractContactController

Set

fgtclb/academic-persons-edit-profile-editing, also part of fgtclb/academic-persons-edit, see What the sets contain

Templates

Profile/List.html and Profile/Index.html, see Templates

The content element is where people maintain their own profile. It is placed on a page behind the frontend login, and shows the person who is logged in the profiles assigned to their frontend user, with two views on the same page:

  • The list of the assigned profiles, the default view. Each row shows the image and the name of a profile, its language, an Edit link and a View link to its public detail page. A profile the owner switched off is listed with a Not public mark and without the View link, so the owner can open it and switch it on again. A profile outside its start and end time, or restricted to a frontend user group the person is not in, is not listed.
  • The editor of one profile, which Edit opens. Every change is saved without a page reload: the fields of the profile, its image, the synchronisation and visibility switches, and its documents, contracts and contacts. Profile editing describes it in full.
A table with one row per profile: image, name, language, and an icon link to view and one to edit the profile.

The list of the profiles assigned to the logged-in frontend user, with the Edit and View links.

The profile editor with the profile image, the switches Disable profile sync and Show my profile publicly, and the sections of profile fields with an edit button each.

The editor of a profile: every field, the image and the documents are saved one by one, without a page reload.

The content element works together with the Person Details content element of academic_persons, which the View link opens.

What it needs 

A logged-in frontend user
The content element answers a visitor who is not logged in with the access denied response of the site, for the whole page. Restrict the page to logged-in users, with Show at any login or the frontend user group of the people who edit, so it does not appear to anybody else. Logging in is left to the site, with the login form of TYPO3 or a single sign-on.
Profiles assigned to the frontend user
The list shows the profiles whose field Assigned Users, on the Frontend Users tab of the profile, names the frontend user. The profiles may be stored in any folder. An editor assigns them in the backend, or the commands of academic_persons create and assign them for the frontend users, see the frontend user synchronisation of academic_persons. A frontend user without a profile sees No profiles found.
The detail page
The View link leads to the page set in the site setting plugin.tx_academicpersons.detailPid , the detail page of the person lists of academic_persons. That page has to carry a Person Details content element. There is no separate setting for this extension, see Include the site set.
The page type of the editor
The editor saves through the page type 1733735, which the site set and the static template deliver. A route enhancer that maps page types to a suffix has to list it, see The page type of the JSON endpoints.

The content element is never cached, every view of it is rendered for the person who asks. It renders no header of its own, the content element layout of the site renders the header, see Breaking: The profile editing plugin renders no content element header.

Settings 

The content element has no plugin options, there is no tab of its own in the backend form. What it shows and allows is configured for the whole site or installation, in these places:

What Where See
Which fields and sections the editor shows, in which order, which of them are required, locked or read only, and which actions a document section offers Configuration/AcademicPersons/Settings.yaml of a site package, shared with academic_persons Profile editor and validation, Which fields can be edited
Fields the synchronisation owns, which stay locked the configuration of the frontend user synchronisation of academic_persons Fields the synchronisation owns
Whether the visibility switch Show my profile publicly is offered special.hidden in the same settings file Visibility switch
The languages a profile is translated into after an edit extension configuration profile.allowedLanguages General configuration
The folder an uploaded image is stored in, its maximum size and its file types TypoScript plugin.tx_academicpersonsedit.settings.editForm.profileImage Upload
The page the View link leads to site setting plugin.tx_academicpersons.detailPid Include the site set
Whether the page loads the editor script site setting plugin.tx_academicpersonsedit.assets.js Load the script or bring your own
The labels of the list and the editor TypoScript plugin.tx_academicpersonsedit._LOCAL_LANG Labels
The markup and the look template overrides and the stylesheet of the site package Templates, Styling

Pitfalls 

  • The editor needs its script. Every field and button of the editor is driven by the script of the extension. Switching plugin.tx_academicpersonsedit.assets.js off without bringing a script of your own leaves an editor that saves nothing.
  • The TypoScript has to be included. A site package that copies the TypoScript of the extension instead of including the set or the static template lacks the page type of the editor. The editor then shows a message instead of saving, see The page type of the JSON endpoints.
  • The name is locked by default. First, middle and last name usually come from the frontend user and can be edited neither in the frontend nor in the backend until the settings file unlocks them, see Which fields can be edited.