table . '_' . $newUid] = [ 'class' => '', 'label' => $params['value'], 'path' => '', 'sprite' => $this->iconFactory->getIconForRecord($this->table, [], Icon::SIZE_SMALL)->render(), 'style' => '', 'table' => $this->table, 'text' => sprintf($this->getLanguageService()->sL('LLL:EXT:news/Resources/Private/Language/locallang_be.xlf:tag_suggest'), $params['value']), 'uid' => $newUid, ]; $configuration = GeneralUtility::makeInstance(EmConfiguration::class); $pid = $configuration->getTagPid(); if ($pid === 0) { $pid = $this->getTagPidFromTsConfig($params['uid']); } if ($pid !== 0) { $rows[$this->table . '_' . $newUid]['pid'] = $pid; } } return $rows; } /** * Get pid for tags from TsConfig * * @param int $newsUid uid of current news record * @return int */ protected function getTagPidFromTsConfig($newsUid): int { $pid = 0; $newsRecord = BackendUtilityCore::getRecord('tx_news_domain_model_news', (int)$newsUid); $pagesTsConfig = BackendUtilityCore::getPagesTSconfig($newsRecord['pid']); if (isset($pagesTsConfig['tx_news.']) && isset($pagesTsConfig['tx_news.']['tagPid'])) { $pid = (int)$pagesTsConfig['tx_news.']['tagPid']; } return $pid; } }