Attention
TYPO3 v6 has reached its end-of-life April 18th, 2017 and is not maintained by the community anymore. Looking for a stable version? Use the version switch on the top left.
There is no further ELTS support. It is strongly recommended updating your project.
RECORDS¶
Introduction¶
This object is meant for displaying lists of records from a variety of tables. Contrary to the CONTENT object, it does not allow very fine selections of records (as it has no "select" property).
The register-key SYS_LASTCHANGED
is updated with the tstamp-field of
the records selected which has a higher value than the current.
Note
Records with parent ids (pid's) for non-accessible pages (that is hidden, timed or access-protected pages) are normally not selected. Pages may be of any type, except recycler. Disable the check with the dontCheckPid option.
Property details¶
source¶
Property
source
Data type
records-list /stdWrap
Description
List of record-id's, optionally with prepended table-names.
Example:
source = tt_content_34, 45, tt_links_56
categories¶
Property
categories
Data type
categories-list /stdWrap
Description
Comma-separated list of system categories uid's. Records related to these categories will be retrieved and made available for rendering.
Only records from the tables defined in the tables property will be retrieved.
This property has the following sub-property:
- relation
Name of the categories-relation field to use for building the list of categorized records, as there can be several such fields on a given table.
Warning
If both source
and categories
properties are defined,
the source
property will take precedence, as it is considered
more precisely targeted.
tables¶
Property
tables
Data type
list of tables /stdWrap
Description
List of accepted tables. For items listed in the source property which are not prepended with a table name, the first table will be used.
Records from tables configured in conf are also allowed.
Example:
tables = tt_content, tt_address, tt_links
conf.tx_myexttable = TEXT
conf.tx_myexttable.value = Hello world
This adds the tables tt_content, tt_address, tt_links and tx_myexttable.
conf¶
Property
conf.[table name]
Data type
Description
Configuration array, which defines the rendering for records from table table name.
Default
If this is not defined, the rendering of the records is done with the top-level object [table name] - just like when ".renderObj" is not set for the cObject CONTENT!
dontCheckPid¶
Property
dontCheckPid
Data type
boolean /stdWrap
Description
Normally a record cannot be selected, if its parent page (pid) is not accessible for the website user. This option disables that check.
Default
0
Examples¶
Selection with source¶
Taken from the rendering of the "Insert records" content element as defined in "css_styled_content".
tt_content.shortcut = COA
tt_content.shortcut {
20 = CASE
20.key.field = layout
20.0 = RECORDS
20.0 {
source.field = records
tables = {$content.shortcut.tables}
}
...
}
Since no conf
property is defined, the rendering will
look for a top-level TypoScript object bearing the name of the
table to be rendered (e.g. "tt_content").
Selection with source II¶
20 = RECORDS
20 {
source = 10,12
dontCheckPid = 1
tables = tt_content
}
This example loads the content elements with the UIDs 10 and 12 no matter where these elements are located and whether these pages are accessible for the current user.
Selection with categories¶
Taken from the rendering of the "Categorized content elements" special menu as defined in "css_styled_content".
categorized_content = RECORDS
categorized_content {
categories.field = selected_categories
categories.relation.field = category_field
tables = tt_content
conf.tt_content = TEXT
conf.tt_content {
stdWrap.field = header
stdWrap.typolink.parameter = {field:pid}#{field:uid}
stdWrap.typolink.parameter.insertData = 1
stdWrap.wrap = <li>|</li>
}
wrap = <ul>|</ul>
}
Contrary to the previous example, in this case the conf
property
is present and defines a very simple rendering of each content element
(i.e. the header with a direct link to the content element).