Frontend output
EXT:thuecat registers Extbase controller actions and ships template stubs, but no content elements. You define the content elements in your own extension or sitepackage and point them at the registered plugins, so rendering stays under your control.
Plugins and templates
The extension name is Thue. It registers six plugins, four for tourist attractions and two
for trails. Each plugin renders one template. List plugins render each item through the List
template of their record kind and cache it on its own, so an item shown in several lists is rendered
once. See Caching.
Tourist attractions
| Plugin name | Purpose | Template | FlexForm settings |
|---|---|---|---|
Tourist | Paginated list of attractions, limited to the storage folders in its
pages
field where
set, refined by the search-and-filter form on the same page. With an editor preset it becomes
a filtered list, see Filtered list. | List | optional preset: towns, categories, keywords, pets,
is, public. Optional overrides of the Site settings:
items, page.. |
Tourist | Fixed set of attractions picked by the editor, in the picked order. No filtering, no pagination. | Selected | selected |
Tourist | Search-and-filter form. Submits into the list plugin on the same page, or to the configured search page. | Search | none |
Tourist | Detail view of one attraction, taken from the URL or pinned by the editor. | Show | optional selected |
Trails
| Plugin name | Purpose | Template | FlexForm settings |
|---|---|---|---|
Trail | Fixed set of trails picked by the editor, in the picked order. | Selected | selected |
Trail | Detail view of one trail, taken from the URL or pinned by the editor. | Show | optional selected |
Trails have no filterable list and no search form.
Required pages
The plugins link to each other across pages, but they cannot discover those pages on their own. Set up the following pages once and feed their uids into the site configuration, see Site settings:
- Attraction detail page -- carries the attraction detail content element; target for links to a
single attraction (
thuecat_).attraction_ show - Trail detail page -- carries the trail detail content element; target for links to a single
trail (
thuecat_).trail_ show - Search result page -- carries a list content element; search forms on pages without a list
submit here (
thuecat_). See Search and list on one page.attraction_ search - Storage folder -- where the import configuration writes the records (
storage). Not a site setting: a list content element can be narrowed to it through itsPid pagesfield, and left empty it is not limited to any storage page.
Site settings
Provide a site set that maps site settings onto the plugin configuration and include it in your site. Fill in the page ids under Settings in the site configuration.
settings:
thuecat.pois.pid_show:
label: 'Detail Page for Tourist Attractions'
description: 'The page providing the detail pages for tourist attractions'
category: 'page.pids'
type: 'int'
default: 0
thuecat.pois.pid_search:
label: 'Search Result Page for Tourist Attractions'
description: 'The page providing the list of tourist attractions, used as target for search form submissions'
category: 'page.pids'
type: 'int'
default: 0
thuecat.trails.pid_show:
label: 'Detail Page for Trails'
description: 'The page providing the detail pages for trails'
category: 'page.pids'
type: 'int'
default: 0
thuecat.settings.itemsPerPage:
label: 'Tourist Attractions per Page'
description: 'Number of tourist attractions shown per page in the list view'
category: 'list'
type: 'int'
default: 20
plugin.tx_thuecat.settings {
page.pid {
thuecat_attraction_show = {$thuecat.pois.pid_show}
thuecat_attraction_search = {$thuecat.pois.pid_search}
thuecat_trail_show = {$thuecat.trails.pid_show}
}
itemsPerPage = {$thuecat.settings.itemsPerPage}
}
Content elements
Register one content element per plugin in your own extension or sitepackage, for example with
TYPO3 Content Blocks. Each content element wires its CType to a plugin of the Thue
extension.
Define one Extbase plugin object carrying the Thue extension name, once, in your site set.
Each content element copies it and names its plugin. A dedicated object keeps other extensions that
wire their own plugins into content elements on the same site from overwriting the extension name:
lib.myvendorThuecatPlugin = EXTBASEPLUGIN
lib.myvendorThuecatPlugin {
extensionName = ThueCat
}
tt_content.myvendor_attractionlistselected =< lib.contentBlock
tt_content.myvendor_attractionlistselected {
20 =< lib.myvendorThuecatPlugin
20 {
pluginName = TouristAttractionListSelected
}
}
A list content element can be narrowed to the storage folder through its
pages
field.
A full, ready-to-use content element definition is shown in Content element example.
Templates
The shipped stubs under EXT: are registered at
template. Override them by adding a higher index:
plugin.tx_thuecat.view {
templateRootPaths.20 = EXT:my_extension/Resources/Private/Templates/
partialRootPaths.20 = EXT:my_extension/Resources/Private/Partials/
layoutRootPaths.20 = EXT:my_extension/Resources/Private/Layouts/
}
The templates are
Search and filter
Search and list on one page
The search-and-filter form adapts to what shares its page:
- With a list (plain or filtered) on the page the form posts to the same page and the list re-renders with the result.
- Without a list on the page the form targets the configured search result page
(
page.).pid. thuecat_ attraction_ search - On a filtered list the preset fields are not shown in the search form, but rendered as hidden fields to preserve the pre-selection. The visitor refines the remaining fields but cannot widen past the preset.
After a search the form re-populates with the submitted values, so the visitor keeps their input.
Filtered list
A filtered list is the list plugin with a preset in its FlexForm, for example a fixed set of towns. Visitors refine within the preset but never widen it. The preset fields are described in Presets.