Content element example
A complete, ready-to-use content element built with TYPO3 Content Blocks. This example is the
selected list: an editor picks a fixed set of attractions, rendered in the chosen order. Replace
myvendor with your own vendor name.
name: myvendor/attraction-list-selected
group: Thuecat Attraction
prefixFields: true
prefixType: vendor
fields:
- identifier: TYPO3/Header
type: Basic
- identifier: 'pi_flexform'
type: 'FlexForm'
useExistingField: true
fields:
- identifier: 'settings.selectedRecords'
type: 'Select'
renderType: 'selectMultipleSideBySide'
foreign_table: 'tx_thuecat_tourist_attraction'
foreign_table_where: 'AND {#tx_thuecat_tourist_attraction}.{#sys_language_uid} IN (0, -1)'
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
}
}
The
settings. FlexForm field lets the editor choose the attractions;
the Tourist plugin renders them via the Selected template in the
picked order.
A selected list of trails is the same content element with
tx_ as
foreign_ and Trail as plugin name.
The other content elements follow the same shape, wired to their plugin name, with these fields:
| Content element | Plugin name | Fields | Flexform Fields |
|---|---|---|---|
| List | Tourist |
pages
, recursive |
settings.,
settings. |
| Filtered list | Tourist | same as the list | same as the list, plus
settings.,
settings.,
settings. |
| Search and filter | Tourist | none | none |
| Attraction detail | Tourist | none |
settings. (makes the plugin show the selected record, don't use
as a link target for list pages) |
| Trail detail | Trail | none |
settings. (makes the plugin show the selected record, don't use
as a link target for list pages) |
What each field does, and how to start the category and keyword trees at the right parent category, is described in Plugin settings.