Files
VITEC-website/packages/vitec/ext_localconf.php
Oliver Rasche 710f95794c Add Solr search: EXT:solr 14 integration and JSON search endpoint
Apache Solr 10 runs on a dedicated VPS behind a Caddy HTTPS proxy
(vitecsolr.evomedien.de) because the managed webserver only allows
outgoing standard ports. Credentials stay out of git: the site config
carries %env()% placeholders resolved via putenv() in the git-ignored
config/system/additional.php.

- composer: apache-solr-for-typo3/solr 14.0.0-RC1 (the only line
  compatible with TYPO3 14; final 14.0.0 will arrive via composer update)
- config.yaml: read connection https/443, core_en per language,
  env placeholder credentials; .gitignore covers additional.php
- setup.typoscript: config.index_enable = 1 (page indexing silently
  refuses without it), solr_pi_results JSON renderer registration,
  results highlighting, and content field extraction from tt_content
  rows - the headless JSON output has no TYPO3SEARCH markers, so the
  default page content extraction indexed an empty content field
- SearchJsonRenderer (renderer #27): JSON output for the search plugin
  on /search. GET q/page in; { query, page, resultsPerPage, numFound,
  totalPages, results[], suggestions } out. Disables the page cache per
  request: config.no_cache is gone in TYPO3 v14, and q/page are
  excluded from cHash, so cached variants would collide
- ext_localconf.php: q and page added to cacheHash excludedParameters
- SolrIndexCommand (vitec:solr-index): works the index queue from the
  CLI with connection diagnostics and a --debug single-step mode -
  EXT:solr 14 ships no console commands and the backend button indexes
  one item per click
2026-08-21 14:43:44 +02:00

260 lines
7.5 KiB
PHP
Executable File

<?php
defined('TYPO3') || die();
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;
// Configure view template paths for the OG Image backend module
$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['vitec']['view'] = [
'templateRootPaths' => ['10' => 'EXT:vitec/Resources/Private/Templates/'],
'layoutRootPaths' => ['10' => 'EXT:vitec/Resources/Private/Layouts/'],
'partialRootPaths' => ['10' => 'EXT:vitec/Resources/Private/Partials/'],
];
// Register VITEC Backend Layout data provider — 21 BE layouts, one per pages.layout (0..20)
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['BackendLayoutDataProvider']['vitec']
= \Evomedien\Vitec\View\BackendLayoutDataProvider::class;
// Auto-sync pages.backend_layout <- pages.layout via DataHandler hook
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']['vitec-sync-backend-layout']
= \Evomedien\Vitec\Hook\SyncBackendLayoutHook::class;
// XClass BackendLayoutView so the page module always reflects pages.layout
// without the editor having to set backend_layout manually.
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Backend\View\BackendLayoutView::class] = [
'className' => \Evomedien\Vitec\View\VitecBackendLayoutView::class,
];
// Register custom VITEC CKEditor RTE preset
$GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['vitec'] = 'EXT:vitec/Configuration/RTE/Vitec.yaml';
// FormEngine fieldWizard: "Structured Data generieren" button below the
// product structureddata field (see TCA + StructuredDataGeneratorWizard).
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1750000000] = [
'nodeName' => 'structuredDataGenerator',
'priority' => 40,
'class' => \Evomedien\Vitec\Backend\FormEngine\StructuredDataGeneratorWizard::class,
];
(static function () {
// Register plugins
ExtensionUtility::configurePlugin(
'Vitec',
'Productlist',
[
\Evomedien\Vitec\Controller\ProductController::class => 'list'
],
[
\Evomedien\Vitec\Controller\ProductController::class => 'list'
]
);
ExtensionUtility::configurePlugin(
'Vitec',
'Simplecard',
[
\Evomedien\Vitec\Controller\SimplecardController::class => 'list'
],
[
\Evomedien\Vitec\Controller\SimplecardController::class => 'list'
]
);
ExtensionUtility::configurePlugin(
'Vitec',
'Productshow',
[
\Evomedien\Vitec\Controller\ProductController::class => 'show'
],
[
\Evomedien\Vitec\Controller\ProductController::class => 'show'
]
);
ExtensionUtility::configurePlugin(
'Vitec',
'Usecaseshow',
[
\Evomedien\Vitec\Controller\UsecaseController::class => 'show'
],
[
\Evomedien\Vitec\Controller\UsecaseController::class => 'show'
]
);
ExtensionUtility::configurePlugin(
'Vitec',
'Marketshow',
[
\Evomedien\Vitec\Controller\MarketController::class => 'show'
],
[
\Evomedien\Vitec\Controller\MarketController::class => 'show'
]
);
ExtensionUtility::configurePlugin(
'Vitec',
'Marketlist',
[
\Evomedien\Vitec\Controller\MarketController::class => 'list'
],
[
\Evomedien\Vitec\Controller\MarketController::class => 'list'
]
);
ExtensionUtility::configurePlugin(
'Vitec',
'Solutionlist',
[
\Evomedien\Vitec\Controller\SolutionController::class => 'list'
],
[
\Evomedien\Vitec\Controller\SolutionController::class => 'list'
]
);
ExtensionUtility::configurePlugin(
'Vitec',
'Solutionshow',
[
\Evomedien\Vitec\Controller\SolutionController::class => 'show'
],
[
\Evomedien\Vitec\Controller\SolutionController::class => 'show'
]
);
ExtensionUtility::configurePlugin(
'Vitec',
'Usecaselist',
[
\Evomedien\Vitec\Controller\UsecaseController::class => 'list'
],
[
\Evomedien\Vitec\Controller\UsecaseController::class => 'list'
]
);
ExtensionUtility::configurePlugin(
'Vitec',
'Downloadcard',
[
\Evomedien\Vitec\Controller\DownloadController::class => 'list, show'
],
[
\Evomedien\Vitec\Controller\DownloadController::class => 'list, show'
]
);
ExtensionUtility::configurePlugin(
'Vitec',
'Downloadcardcollection',
[
\Evomedien\Vitec\Controller\DownloadController::class => 'downloadcardcollection'
],
[
\Evomedien\Vitec\Controller\DownloadController::class => 'downloadcardcollection'
]
);
ExtensionUtility::configurePlugin(
'Vitec',
'Datasheets',
[
\Evomedien\Vitec\Controller\DownloadController::class => 'datasheets'
],
[
\Evomedien\Vitec\Controller\DownloadController::class => 'datasheets'
]
);
ExtensionUtility::configurePlugin(
'Vitec',
'Eventlist',
[
\Evomedien\Vitec\Controller\EventController::class => 'list'
],
[
\Evomedien\Vitec\Controller\EventController::class => 'list'
]
);
ExtensionUtility::configurePlugin(
'Vitec',
'Locationlist',
[
\Evomedien\Vitec\Controller\LocationController::class => 'list'
],
[
\Evomedien\Vitec\Controller\LocationController::class => 'list'
]
);
ExtensionUtility::configurePlugin(
'Vitec',
'Customerlogos',
[
\Evomedien\Vitec\Controller\CustomerController::class => 'list'
],
[
\Evomedien\Vitec\Controller\CustomerController::class => 'list'
]
);
ExtensionUtility::configurePlugin(
'Vitec',
'Modelcard',
[
\Evomedien\Vitec\Controller\ModelcardController::class => 'list'
],
[
\Evomedien\Vitec\Controller\ModelcardController::class => 'list'
]
);
ExtensionUtility::configurePlugin(
'Vitec',
'Contactform',
[
\Evomedien\Vitec\Controller\FormController::class => 'list'
],
[
\Evomedien\Vitec\Controller\FormController::class => 'list'
]
);
ExtensionUtility::configurePlugin(
'Vitec',
'Demoform',
[
\Evomedien\Vitec\Controller\FormController::class => 'list'
],
[
\Evomedien\Vitec\Controller\FormController::class => 'list'
]
);
ExtensionUtility::configurePlugin(
'Vitec',
'Helpdeskform',
[
\Evomedien\Vitec\Controller\FormController::class => 'list'
],
[
\Evomedien\Vitec\Controller\FormController::class => 'list'
]
);
})();
// The JSON search endpoint (SearchJsonRenderer) uses plain `q` and `page` GET
// parameters. Without this exclusion TYPO3 demands a cHash for them and answers
// with an error page; the no_cache condition in the Vitecset TypoScript makes
// sure search responses are rendered fresh instead of sticking in the page cache.
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'][] = 'q';
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'][] = 'page';