mirror of
https://github.com/Codappix/search_core.git
synced 2024-11-22 20:16:12 +01:00
TASK: Check multiple fields for pages to be used as title
This commit is contained in:
parent
a737501dac
commit
7722c37ea5
1 changed files with 8 additions and 0 deletions
|
@ -57,6 +57,14 @@ class PagesIndexer extends TcaIndexer
|
||||||
*/
|
*/
|
||||||
protected function prepareRecord(array &$record)
|
protected function prepareRecord(array &$record)
|
||||||
{
|
{
|
||||||
|
$possibleTitleFields = ['nav_title', 'tx_tqseo_pagetitle_rel', 'title'];
|
||||||
|
foreach ($possibleTitleFields as $searchTitleField) {
|
||||||
|
if (isset($record[$searchTitleField]) && trim($record[$searchTitleField])) {
|
||||||
|
$record['search_title'] = trim($record[$searchTitleField]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$record['content'] = $this->fetchContentForPage($record['uid']);
|
$record['content'] = $this->fetchContentForPage($record['uid']);
|
||||||
parent::prepareRecord($record);
|
parent::prepareRecord($record);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue