Routing
EXT:thuecat ships route enhancers for its plugins, so detail pages, list pagination, list filters and the search get readable URLs:
/ausflugsziel/stadtmuseum-erfurt
/liste/ort/erfurt+weimar/kategorie/museum/haustiere-erlaubt/2
/liste?q=Gemeindebrunnen%20Weimar
None of these URLs carries a tx_ parameter or a c.
On this page
Route enhancers
Import the route enhancers of the plugins the site uses into its site configuration. Each file routes one plugin:
imports:
- { resource: 'EXT:thuecat/Configuration/Routes/TouristAttractionShow.yaml' }
- { resource: 'EXT:thuecat/Configuration/Routes/TouristAttractionList.yaml' }
- { resource: 'EXT:thuecat/Configuration/Routes/TrailShow.yaml' }
An enhancer only applies to pages with the matching page role, see Page role. Pages without the role keep query-string URLs, and those keep working.
The Tourist plugin needs no route: its form submits into the list plugin, and
the list redirects to a routed URL.
Page role
Each page carrying a routed plugin needs the ThüCAT page role in its page properties, next to Contains plugin:
| Role | Value | Set it on |
|---|---|---|
| Tourist attraction detail | thuecat_ | the attraction detail page |
| Trail detail | thuecat_ | the trail detail page |
| Tourist attraction list | thuecat_ | every page with a list or filtered list, including the search result page |
The role is the same in all languages of a page; translations take it from the default language.
What editors see
On a page with routed ThüCAT plugins the page module shows the page's current role. When the role does not match the plugins on the page, or is empty, it says which role to set. Pages without routed plugins show nothing.
EXT:thuecat registers no content elements, so it cannot tell which plugin a content element renders. The package that defines the content elements tells it:
Map each routed content element type to the page role its plugin needs, in the page TSconfig of your site set. Content element types without a line are ignored by the page module hint:
tx_thuecat.pageRoles {
myvendor_attractionshow = thuecat_touristattractionshow
myvendor_trailshow = thuecat_trailshow
myvendor_attractionlist = thuecat_touristattractionlist
myvendor_attractionlistfiltered = thuecat_touristattractionlist
}
Detail pages
A detail URL is the detail page's path followed by the record's slug. Records get their slug from their title when they are created; existing records get one from the upgrade wizard, see Slugs. A slug does not change when the title changes upstream, so URLs stay stable.
Slugs are unique within a site and resolve only on the site whose page tree stores the record. A slug of another site gives 404.
A translated record has a slug of its own and resolves under its language's base:
/en/. The translated slug under another language's base, for
example without /en/, gives 404.
Lists
- Pagination
- The page number is the last path segment:
/liste/. The first page has none.2 - Filters
-
Each active filter is a segment in a fixed order: towns, categories, keywords, then the flags. Relation filters carry a label and the slugs of the selected records, joined by
+and sorted, so a selection has one URL whatever order it was picked in:Filter German English Towns /ort/erfurt+weimar /town/erfurt+weimar Categories /kategorie/museum /category/museum Keywords /stichwort/romantisch /keyword/romantic Pets allowed /haustiere-erlaubt /pets-allowed Free entry /eintritt-frei /free-entry Public access /oeffentlich-zugaenglich /public-access Towns and categories get their slugs like detail records. A segment with a slug no record of the site carries gives 404. The labels follow the language's locale: English for
en_*, German otherwise.Filters the content element locks in its settings are not part of the URL; they apply anyway.
- Search
-
The search word is the query argument
q, next to the path:/liste/. The search form submits into the list, the list redirects there, and pagination keeps it.ort/ erfurt?q=Dom qis excluded from the cHash. The list and search actions are not cached in the page cache, so no cached page depends on it.
To change labels or segment values, copy
EXT: into your site configuration
instead of importing it. The requirements of each flag must list every value its locale
maps.
A complete example for the attraction detail page is shown in Routing example.