This commit is contained in:
Jürgen Mummert
2026-01-09 22:01:16 +01:00
parent 56d806c579
commit 99ef883da5
7 changed files with 138 additions and 144 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
use Contao\DC_Table;
$GLOBALS['TL_DCA']['tl_search_files'] = [
$GLOBALS['TL_DCA']['tl_search_pdf'] = [
'config' => [
'dataContainer' => DC_Table::class,
'sql' => [
+27 -50
View File
@@ -4,17 +4,14 @@ use Contao\CoreBundle\DataContainer\PaletteManipulator;
use Contao\System;
/**
* -------------------------------------------------
* Fields
* -------------------------------------------------
*/
$GLOBALS['TL_DCA']['tl_settings']['fields']['meilisearch_host'] = [
'inputType' => 'text',
'eval' => [
'mandatory' => true,
'rgxp' => 'url',
'tl_class' => 'w50',
'rgxp' => 'url',
'tl_class' => 'w50',
],
];
@@ -22,7 +19,7 @@ $GLOBALS['TL_DCA']['tl_settings']['fields']['meilisearch_index'] = [
'inputType' => 'text',
'eval' => [
'mandatory' => true,
'tl_class' => 'w50',
'tl_class' => 'w50',
],
];
@@ -30,7 +27,7 @@ $GLOBALS['TL_DCA']['tl_settings']['fields']['meilisearch_api_write'] = [
'inputType' => 'text',
'eval' => [
'mandatory' => true,
'tl_class' => 'w50',
'tl_class' => 'w50',
'hideInput' => true,
],
];
@@ -39,7 +36,7 @@ $GLOBALS['TL_DCA']['tl_settings']['fields']['meilisearch_api_search'] = [
'inputType' => 'text',
'eval' => [
'mandatory' => true,
'tl_class' => 'w50',
'tl_class' => 'w50',
'hideInput' => true,
],
];
@@ -58,71 +55,50 @@ $GLOBALS['TL_DCA']['tl_settings']['fields']['meilisearch_imagesize'] = [
return $options;
},
'eval' => [
'tl_class' => 'w50',
'chosen' => true,
'tl_class' => 'w50',
'chosen' => true,
'includeBlankOption' => true,
],
// 🔥 DAS HAT GEFEHLT
'sql' => "int(10) unsigned NOT NULL default 0",
];
$GLOBALS['TL_DCA']['tl_settings']['fields']['meilisearch_index_past_events'] = [
'inputType' => 'checkbox',
'eval' => [
'tl_class' => 'w50 clr',
],
];
$GLOBALS['TL_DCA']['tl_settings']['fields']['meilisearch_fallback_image'] = [
'inputType' => 'fileTree',
'eval' => [
'filesOnly' => true,
'fieldType' => 'radio',
'tl_class' => 'w50',
'tl_class' => 'w50',
],
'sql' => "varbinary(16) NULL",
];
$GLOBALS['TL_DCA']['tl_settings']['fields']['meilisearch_index_past_events'] = [
$GLOBALS['TL_DCA']['tl_settings']['fields']['meilisearch_index_pdfs'] = [
'label' => &$GLOBALS['TL_LANG']['tl_settings']['meilisearch_index_pdfs'],
'inputType' => 'checkbox',
'eval' => [
'tl_class' => 'w50 clr',
'eval' => [
'tl_class' => 'w50',
],
'sql' => "char(1) NOT NULL default '1'",
];
/**
* -------------------------------------------------
* Datei-Indexierung (Tika)
* -------------------------------------------------
*/
$GLOBALS['TL_DCA']['tl_settings']['fields']['meilisearch_index_files'] = [
$GLOBALS['TL_DCA']['tl_settings']['fields']['meilisearch_index_office'] = [
'label' => &$GLOBALS['TL_LANG']['tl_settings']['meilisearch_index_office'],
'inputType' => 'checkbox',
'eval' => [
'tl_class' => 'w50',
'submitOnChange' => true,
],
'sql' => "char(1) NOT NULL default '0'",
];
$GLOBALS['TL_DCA']['tl_settings']['fields']['meilisearch_tika_url'] = [
'inputType' => 'text',
'eval' => [
'rgxp' => 'url',
'mandatory' => true,
'tl_class' => 'w50 clr',
],
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default '0'",
];
/**
* -------------------------------------------------
* Selector / Subpalette
* -------------------------------------------------
*/
$GLOBALS['TL_DCA']['tl_settings']['palettes']['__selector__'][] = 'meilisearch_index_files';
$GLOBALS['TL_DCA']['tl_settings']['subpalettes']['meilisearch_index_files']
= 'meilisearch_tika_url';
/**
* -------------------------------------------------
* Palette
* -------------------------------------------------
*/
PaletteManipulator::create()
->addLegend('meilisearch_legend', null, PaletteManipulator::POSITION_AFTER, true)
->addField('meilisearch_host', 'meilisearch_legend')
@@ -132,5 +108,6 @@ PaletteManipulator::create()
->addField('meilisearch_imagesize', 'meilisearch_legend')
->addField('meilisearch_fallback_image', 'meilisearch_legend')
->addField('meilisearch_index_past_events', 'meilisearch_legend')
->addField('meilisearch_index_files', 'meilisearch_legend')
->addField('meilisearch_index_pdfs', 'meilisearch_legend')
->addField('meilisearch_index_office', 'meilisearch_legend')
->applyToPalette('default', 'tl_settings');
@@ -28,10 +28,10 @@ $GLOBALS['TL_LANG']['tl_settings']['meilisearch_index_past_events'][0]
$GLOBALS['TL_LANG']['tl_settings']['meilisearch_index_past_events'][1]
= 'Vergangene Kalender-Events werden ebenfalls in Meilisearch indexiert.';
$GLOBALS['TL_LANG']['tl_settings']['meilisearch_index_files'] = [
'Dateien indexieren',
'Aktiviert die Indexierung von PDF-Dateien sowie DOCX, XLSX und PPTX.',
$GLOBALS['TL_LANG']['tl_settings']['meilisearch_index_pdfs'] = [
'PDFs indexieren',
'Aktiviert die Indexierung von PDF-Dateien für die Suche.',
];
$GLOBALS['TL_LANG']['tl_settings']['meilisearch_tika_url']
= ['Apache Tika URL', 'URL der Apache Tika Instanz (z. B. https://tika.domain.tld).'];
$GLOBALS['TL_LANG']['tl_settings']['meilisearch_index_office']
= ['Office-Dateien indexieren', 'DOCX, XLSX und PPTX in die Suche aufnehmen.'];
@@ -4,6 +4,7 @@ Contao 5 Frontend Module Template
#}
<!-- indexer::stop -->
{% block meilisearch %}
<div
id="topsearch"
class="meilisearch-search"
@@ -218,4 +219,5 @@ Contao 5 Frontend Module Template
}
});
</script>
{% endblock %}
<!-- indexer::continue -->