i have a test enviroment with the intro-package, ods_osm and tt_address installed. on one page i want to show a table with marker data from tt_address (which is also used in the map). I am still struggling with typoscript, but this is what i have got so far:
Page ext Template:
lib.markerTable = FLUIDTEMPLATE
lib.markerTable {
templateName = MarkerDetailsTemplate
templateRootPaths {
10 = fileadmin/user_upload/
}
variables {
markerData.select {
pidInList = 85
selectFields = uid, name, address, www
}
}
}
My fluidtemplate:
<table>
<thead>
<tr>
<th>Name</th>
<th>Address</th>
<th>Website</th>
</tr>
</thead>
<tbody>
<f:for each="{markerData}" as="marker">
<tr>
<td>{marker.name}</td>
<td>{marker.address}</td>
<td><a href="{marker.www}" target="_blank">{marker.www}</a></td>
</tr>
</f:for>
</tbody>
</table>
To render the table i include this line into the Default.html:
<div class="marker-table-section">
<f:cObject typoscriptObjectPath="lib.markerTable" />
</div>
But in the Frontend i only see the table headers. Where i am going wrong?
Thanks!
Edit(TSOB entry):
[markerTable] = FLUIDTEMPLATE
[templateName] = MarkerDetailsTemplate
[templateRootPaths]
[variables]
[markerData]
[select]
[pidInList] = 85
[selectFields] = uid, name, address, www
You need to use the DatabaseQueryProcessor
like this:
lib.markerTable = FLUIDTEMPLATE
lib.markerTable {
templateName = MarkerDetailsTemplate
templateRootPaths {
10 = fileadmin/user_upload/
}
dataProcessing.10 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
dataProcessing.10 {
table = tt_address
pidInList = 85
selectFields = tt_address.*
}
}
Then you can access the fields like this:
<table>
<thead>
<tr>
<th>Name</th>
<th>Address</th>
<th>Website</th>
</tr>
</thead>
<tbody>
<f:for each="{records}" as="record">
<tr>
<td>{record.data.name}</td>
<td>{record.data.address}</td>
<td><a href="{record.data.www}" target="_blank">{record.data.www}</a></td>
</tr>
</f:for>
</tbody>
</table>