Route enhancers
This extension ships three ready made route enhancers below
Configuration/. TYPO3 does not read those files on its own —
they are fragments that have to be imported from the configuration of the site
which shows the plugins.
Each file covers exactly one plugin, so which of them you import follows from which plugins the site actually uses.
What the files enhance
Detail.yaml - Enhancer
Profilefor the pluginDetail Plugin Detail, argument namespacetx_. One route,academicpersons_ detail /, for the{profile_ name} detailaction, mapping the argumentprofile. The path segment is resolved by aPersistedon the tableAlias Mapper tx_over the fieldacademicpersons_ domain_ model_ profile slug. List.yaml - Enhancer
Profilefor the pluginList Plugin List, argument namespacetx_. Two routes for theacademicpersons_ list listaction:{localized_forpage}- {page} demand/andcurrent Page /for{letter} demand/. The page number is limited to aalphabet Filter Staticfrom 1 to 1000, the letter to aRange Mapper StaticfromRange Mapper atoz, and the word in front of the page number is translated by aLocale—Modifier pageby default,seitefor German. ListAnd Detail. yaml - Enhancer
Profilefor the pluginList And Detail Plugin List, argument namespaceAnd Detail tx_. It is the union of the two above: the detail route, the pagination route and the letter route, with the same aspects, because that plugin renders both the list and the detail view.academicpersons_ listanddetail
Which file to import
The three enhancers are bound to three different plugins, so they never collide and importing more than one is normal:
- A site that puts the List plugin on one page and the
Detail plugin on another — the usual setup, where the list
links to the detail page through the plugin setting
detail— importsPid List.andyaml Detail..yaml - A site that puts the single ListAndDetail plugin on one page
imports
Listonly.And Detail. yaml - A site that uses both variants imports all three.
The remaining plugins of this extension —
Selected,
Selected and
Card
— take no frontend arguments, so no
enhancer is shipped for them.
Importing into a site configuration
Add the resources to the
imports
of the site:
imports:
- resource: 'EXT:academic_persons/Configuration/Routes/List.yaml'
- resource: 'EXT:academic_persons/Configuration/Routes/Detail.yaml'
- resource: 'EXT:academic_persons/Configuration/Routes/ListAndDetail.yaml'
What the URLs look like
Assuming the list plugin sits on a page with the slug /persons and the
detail plugin on /persons/, the URLs change as follows.
/persons?tx_academicpersons_list%5Bdemand%5D%5BcurrentPage%5D=2
/persons?tx_academicpersons_list%5Bdemand%5D%5BalphabetFilter%5D=m
/persons/profile?tx_academicpersons_detail%5Bprofile%5D=42
/persons/page-2
/persons/m
/persons/profile/jane-doe
Caveats
- The detail route needs a slug.
Persistedresolves the path segment against theAlias Mapper slugfield of the profile record, so a profile whose slug is empty cannot be reached through the enhanced URL. The slug is generated by the TCAslugfield, which means it is filled when the record is saved in the backend. Profiles created byacademicpersons:are persisted through the Extbase persistence manager and therefore never pass thecreateprofiles Data, so those records — and records that predate the field — start out with an empty slug and have to be saved once in the backend before the enhanced URL resolves.Handler - The two list routes are alternatives, not a combination. A link that
carries a page number and a letter matches the pagination route, and the
letter stays behind as a query argument —
/persons/.page- 2?tx_ academicpersons_ list [demand] [alphabet Filter]=m - Only the mapped value ranges are put into the path. A page number above 1000, and the empty filter value that the A-Z reset link of the alphabet pagination submits, are outside the mapped ranges, so those links keep their query argument.
- The
localeof theMap Localeis matched against the locale of the site language, with the underscores replaced by hyphens and anchored at the start. The shipped map listsModifier en_andEN.* de_, which means a German language configured asDE.* de-is translated toDE seitewhile a plaindeis not. Adjust the map to the locales your site actually uses. - Unlike the program list of academic_programs, the pagination and the alphabet filter of this extension are rendered as links, not as a form, so their own requests do carry the arguments in the URL and are enhanced.