Skip to content

Commit

Permalink
prepare Plugin and Controller to show Detail Page
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-sc committed Feb 5, 2025
1 parent 586f557 commit 470c760
Show file tree
Hide file tree
Showing 11 changed files with 146 additions and 6 deletions.
6 changes: 6 additions & 0 deletions Classes/Controller/SearchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,10 @@ public function searchBarAction(array $searchParams = []): ResponseInterface
return $this->htmlResponse();
}

public function detailsAction(array $searchParams = []): ResponseInterface
{
$this->view->assign('searchParams', $searchParams);
return $this->htmlResponse();
}

}
40 changes: 40 additions & 0 deletions Configuration/TCA/Overrides/tt_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
'Liszt Search Bar'
);

ExtensionUtility::registerPlugin(
'liszt_common',
'SearchDetails',
'Liszt Search Details'
);

// Adds the content element to the "Type" dropdown
ExtensionManagementUtility::addTcaSelectItem(
'tt_content',
Expand All @@ -46,6 +52,18 @@
]
);

ExtensionManagementUtility::addTcaSelectItem(
'tt_content',
'CType',
[
'label' => 'LLL:EXT:liszt_common/Resources/Private/Language/locallang.xlf:searchdetails_title',
'value' => 'lisztcommon_searchdetails',
'icon' => 'content-text',
'group' => 'plugins',
'description' => 'LLL:EXT:liszt_common/Resources/Private/Language/locallang.xlf:searchdetails_description'
]
);

// configure the backend form fields for SearchList Plugin (no extra fields needed)
$GLOBALS['TCA']['tt_content']['types']['lisztcommon_searchlisting'] = [
'showitem' => '
Expand Down Expand Up @@ -87,3 +105,25 @@
]
]
];


// configure the backend form fields for SearchDetails Plugin (no extra fields needed)
$GLOBALS['TCA']['tt_content']['types']['lisztcommon_searchdetails'] = [
'showitem' => '
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,
--palette--;;general,
header; Title,
bodytext;LLL:EXT:core/Resources/Private/Language/Form/locallang_ttc.xlf:bodytext_formlabel,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access,
--palette--;;hidden,
--palette--;;acces,
',
'columnsOverrides' => [
'bodytext' => [
'config' => [
'enableRichtext' => true,
'richtextConfiguration' => 'default'
]
]
]
];
31 changes: 31 additions & 0 deletions Configuration/TsConfig/page.tsconfig
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,27 @@ mod.web_layout.BackendLayouts {
}
}
}
searchDetails {
title = Liszt Detailseite
## icon = EXT:liszt_web/Resources/Public/Images/BackendLayouts/default.gif
config {
backend_layout {
doktype = 140
colCount = 1
rowCount = 1
rows {
1 {
columns {
1 {
name = Hauptinhalt
colPos = 0
}
}
}
}
}
}
}
}

// add content element to wizard
Expand All @@ -45,9 +66,19 @@ mod.wizards.newContentElement.wizardItems {
list_type = lisztcommon_searchbar
}
}
lisztcommon_searchdetails {
iconIdentifier = content-text
title = LLL:EXT:liszt_common/Resources/Private/Language/locallang.xlf:searchdetails_title
description = LLL:EXT:liszt_common/Resources/Private/Language/locallang.xlf:searchdetails_description
tt_content_defValues {
CType = list
list_type = lisztcommon_searchdetails
}
}
}
show := addToList(lisztcommon_searchlisting)
show := addToList(lisztcommon_searchbar)
show := addToList(lisztcommon_searchdetails)
}
}

Expand Down
8 changes: 5 additions & 3 deletions Configuration/TypoScript/setup.typoscript
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ page {
130 = TEXT
130.value = SearchResults
140 = TEXT
140.value = Detail
140.value = SearchDetails
}
}
templateRootPaths {
Expand Down Expand Up @@ -45,6 +45,10 @@ tt_content {
// same namespace for both plugins on searchresults page
plugin.tx_lisztcommon_searchbar.view.pluginNamespace = tx_liszt_common_searchlisting
plugin.tx_lisztcommon_searchlisting.view.pluginNamespace = tx_liszt_common_searchlisting

// plugin.tx_lisztcommon_searchdetails.view.pluginNamespace = tx_liszt_common_searchlisting


// while two plugins are on searchresults page, the searchbar plugin brings "action index is not allowed by this plugin" by non searchbar actions
// set use default action to avoid this error
plugin.tx_lisztcommon_searchbar.mvc.callDefaultActionIfActionCantBeResolved = 1;
Expand Down Expand Up @@ -85,5 +89,3 @@ plugin.tx_lisztcommon_searchbar.mvc.callDefaultActionIfActionCantBeResolved = 1;
}
}*/

plugin.tx_lisztcommon_searchbar.view.pluginNamespace = tx_liszt_common_searchlisting
plugin.tx_lisztcommon_searchlisting.view.pluginNamespace = tx_liszt_common_searchlisting
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: slub/lisztdetailpage
title: 'Liszt Suchergebnisse Seite'
name: slub/lisztsearchdetailpage
title: 'Liszt Suchergebnisse Detail Seite'
typeName: 140
fields:
- identifier: categories
label: 'Kategorien'
type: Category

24 changes: 24 additions & 0 deletions Resources/Private/Language/de.locallang.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
<trans-unit id="searchbar_description" >
<source>Sucheingabe / Suchschlitz</source>
</trans-unit>
<trans-unit id="searchdetails_title" >
<source>Liszt Detailseite</source>
</trans-unit>
<trans-unit id="searchdetails_description" >
<source>Anzeige einer Detailseite</source>
</trans-unit>
<trans-unit id="searchbar_placeholder" >
<source>Suche in der Bibliografie</source>
</trans-unit>
Expand Down Expand Up @@ -48,6 +54,24 @@
<trans-unit id="searchResults_params_remove_label">
<source>Suchparameter "%s" entfernen</source>
</trans-unit>
<trans-unit resname="config.elasticHostName" id="config.elasticHostName" >
<source>Hostname des Elasticsearch-Servers</source>
</trans-unit>
<trans-unit resname="config.elasticCredentialsFilePath" id="config.elasticCredentialsFilePath" >
<source>Dateipfad der Elasticsearch-Credentials (Passwort, CA-Zertifikat)</source>
</trans-unit>
<trans-unit resname="config.elasticPwdFileName" id="config.elasticPwdFileName" >
<source>Name der Datei, die das Elasticsearch-Passwort enthält</source>
</trans-unit>
<trans-unit resname="config.elasticCaFileName" id="config.elasticCaFileName" >
<source>Name der Datei, die das HTTP-CA-Zertifikat enthält</source>
</trans-unit>
<trans-unit resname="config.paginationRange" id="config.paginationRange" >
<source>Abstände der in der Paginierung anzuzeigenden Seiten zur aktuellen Seite. Kommaseparierte Liste. 1 ist immer implizit gesetzt.</source>
</trans-unit>
<trans-unit resname="config.itemsPerPage" id="config.itemsPerPage" >
<source>Elemente pro Seite der Ergebnisliste</source>
</trans-unit>
<trans-unit resname="currentPage" id="currentPage" >
<source>...</source>
</trans-unit>
Expand Down
6 changes: 6 additions & 0 deletions Resources/Private/Language/locallang.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
<trans-unit id="searchbar_description" >
<source>Sucheingabe / Suchschlitz</source>
</trans-unit>
<trans-unit id="searchdetails_title" >
<source>Liszt Detailseite</source>
</trans-unit>
<trans-unit id="searchdetails_description" >
<source>Anzeige einer Detailseite</source>
</trans-unit>
<trans-unit id="searchbar_placeholder" >
<source>Suche in der Bibliografie</source>
</trans-unit>
Expand Down
24 changes: 24 additions & 0 deletions Resources/Private/Templates/Search/Details.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

{namespace lc=Slub\LisztCommon\ViewHelpers}
<html
xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
xmlns:i="http://typo3.org/ns/Quellenform/Iconpack/ViewHelpers"
data-namespace-typo3-fluid="true">
<f:variable name="languageFilePath">LLL:EXT:{settings.entityTypes.1.extensionName}/Resources/Private/Language/{settings.entityTypes.1.languageFile}.xlf</f:variable>

<div class="searchresults-info frame">
info


</div>


<aside class="sidebar">
aside
</aside>

<div class="content grid-colspan-lg-3 grid-colspan-md-2">
<div class="frame">
content
</div>
</div>
File renamed without changes.
7 changes: 7 additions & 0 deletions ext_localconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@
[ SearchController::class => 'searchBar' ],
);

ExtensionUtility::configurePlugin(
'LisztCommon',
'SearchDetails',
[ SearchController::class => 'details' ],
[ SearchController::class => 'details' ],
);

ExtensionManagementUtility::addPageTSConfig(
'<INCLUDE_TYPOSCRIPT: source="FILE:EXT:liszt_common/Configuration/TsConfig/page.tsconfig">'
);
Expand Down

0 comments on commit 470c760

Please sign in to comment.