[TASK] Added link generation based on fluid templates

Removed search_page_typolink parameter from index
This commit is contained in:
Benjamin Serfhos 2018-10-29 14:13:34 +01:00
parent 4b7337d3fa
commit 209f441b5d
4 changed files with 33 additions and 20 deletions

View file

@ -159,23 +159,6 @@ class TcaTableService implements TcaTableServiceInterface
// Always fallback on public visibility when configured
$record['search_access'] = !empty($groups) ? $groups : [0];
}
if (!isset($record['search_page_typolink'])) {
switch ($this->tableName) {
case 'pages':
$record['search_page_typolink'] = 't3://page?uid=' . $record['uid'];
break;
case 'tt_content':
$record['search_page_typolink'] = 't3://page?uid=' . $record['pid'] . '#' . $record['uid'];
break;
case 'sys_file':
$record['search_page_typolink'] = 't3://file?uid=' . $record['uid'];
break;
default:
$record['search_page_typolink'] = 't3://page?uid=' . $record['pid'];
break;
}
}
}
protected function getWhereClause(): Where

View file

@ -0,0 +1,24 @@
Feature "Added fluid partials for list items"
=============================================
When using a seperate partial for ListItem you can simply adjust for your custom page type:
Example ListItem.html::
-----------------------
.. code-block:: html
:linenos:
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
data-namespace-typo3-fluid="true">
<f:comment>
Add opening for possible different partials based on Document types:
</f:comment>
<f:switch expression="{result.search_document_type}">
<f:case value="your-document-type">{f:render(partial: 'Results/Item/YourDocumentType', arguments: {result: result})}</f:case>
<f:case value="pages">{f:render(partial: 'Results/Item/Page', arguments: {result: result})}</f:case>
<f:defaultCase>{f:render(partial: 'Results/Item/Unknown', arguments: {result: result})}</f:defaultCase>
</f:switch>
</html>

View file

@ -0,0 +1,8 @@
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
data-namespace-typo3-fluid="true">
<f:link.page pageUid="{result.uid}">
[{result.search_document_type}:{result.uid}] - {result.search_title}
</f:link.page>
</html>

View file

@ -1,8 +1,6 @@
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
data-namespace-typo3-fluid="true">
<f:link.typolink parameter="{result.search_page_typolink}">
[{result.search_document_type}:{result.uid}] - {result.search_title}
</f:link.typolink>
<f:render partial="Results/Item/Default" arguments="{result: result}"/>
</html>