Skip to content
Snippets Groups Projects
Commit b81c0869 authored by Georgi Mateev's avatar Georgi Mateev
Browse files

[TASK] Add version checks for sg_seo in order to setup the SEO fields correctly

parent d477ce95
No related branches found
No related tags found
1 merge request!37[TASK] Adapt sg_news to sg_seo 5.0.0
......@@ -56,8 +56,9 @@ foreach (
];
}
$GLOBALS['TCA']['pages']['types'][\SGalinski\SgNews\Utility\BackendNewsUtility::NEWS_DOKTYPE] = [
'showitem' => '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,
if (version_compare(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getExtensionVersion('sg_seo'), '5.0.0', '>=')) {
$GLOBALS['TCA']['pages']['types'][\SGalinski\SgNews\Utility\BackendNewsUtility::NEWS_DOKTYPE] = [
'showitem' => '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,
--palette--;;standard,
--palette--;;titleDescriptionAndHighlightFlag,
--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:pages.palettes.editorial;editorialWithNewsAuthor,
......@@ -85,10 +86,36 @@ $GLOBALS['TCA']['pages']['types'][\SGalinski\SgNews\Utility\BackendNewsUtility::
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language,
--palette--;;language
'
];
$GLOBALS['TCA']['pages']['types'][\SGalinski\SgNews\Utility\BackendNewsUtility::CATEGORY_DOKTYPE] = [
'showitem' => '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,
];
} else {
$GLOBALS['TCA']['pages']['types'][\SGalinski\SgNews\Utility\BackendNewsUtility::NEWS_DOKTYPE] = [
'showitem' => '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,
--palette--;;standard,
--palette--;;titleDescriptionAndHighlightFlag,
--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:pages.palettes.editorial;editorialWithNewsAuthor,
tx_sgnews_content_from_another_page, tx_sgnews_related_news, tx_sgnews_tags,
--div--;' . $localLangDbPath . 'pages.tabs.images,
tx_sgnews_teaser2_image, tx_sgnews_teaser1_image,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.metadata,
tx_projectbase_devnullrobots_flags,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.abstract;abstract,
tx_projectbase_seo_titletag,tx_projectbase_seo_canonicaltag,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.appearance,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.layout;layout,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access,
--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:pages.palettes.visibility;visibility,
--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:pages.palettes.access;access,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.behaviour,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.caching;caching,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.miscellaneous;miscellaneous,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language,
--palette--;;language
'
];
}
if (version_compare(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getExtensionVersion('sg_seo'), '5.0.0', '>=')) {
$GLOBALS['TCA']['pages']['types'][\SGalinski\SgNews\Utility\BackendNewsUtility::CATEGORY_DOKTYPE] = [
'showitem' => '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,
--palette--;;standard,
title, slug, tx_projectbase_path_segment, tx_projectbase_excludefromsluggeneration, tx_realurl_pathsegment, tx_realurl_exclude,
--div--;LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.tabs.seo,
......@@ -115,7 +142,31 @@ $GLOBALS['TCA']['pages']['types'][\SGalinski\SgNews\Utility\BackendNewsUtility::
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language,
--palette--;;language
'
];
];
} else {
$GLOBALS['TCA']['pages']['types'][\SGalinski\SgNews\Utility\BackendNewsUtility::CATEGORY_DOKTYPE] = [
'showitem' => '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,
--palette--;;standard,
title, slug, tx_projectbase_path_segment, tx_projectbase_excludefromsluggeneration, tx_realurl_pathsegment, tx_realurl_exclude,
--div--;' . $localLangDbPath . 'pages.tabs.images,
tx_sgnews_teaser2_image, tx_sgnews_teaser1_image,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.metadata,
tx_projectbase_devnullrobots_flags,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.abstract;abstract,
tx_projectbase_seo_titletag,tx_projectbase_seo_canonicaltag, description,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.appearance,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.layout;layout,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access,
--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:pages.palettes.visibility;visibility,
--palette--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:pages.palettes.access;access,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.behaviour,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.caching;caching,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.miscellaneous;miscellaneous,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language,
--palette--;;language
'
];
}
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns(
'pages',
......@@ -404,29 +455,56 @@ $GLOBALS['TCA']['pages']['palettes']['editorialWithNewsAuthor'] = [
];
foreach ($GLOBALS['TCA']['pages']['columns'] as $languageExcludeField => $_) {
if (!in_array($languageExcludeField, [
'doktype',
'title',
'subtitle',
'description',
'slug',
'tx_projectbase_path_segment',
'tx_projectbase_excludefromsluggeneration',
'tx_sgnews_location',
'tx_sgnews_teaser1_image',
'tx_sgnews_teaser2_image',
'tx_sgnews_tags',
'abstract',
'seo_title',
'canonical_link',
'hidden',
'sys_language_uid',
'tx_languagevisibility_visibility',
'lastUpdated',
'tx_sgnews_date_end',
'tx_sgnews_highlighted',
'tx_sgnews_never_highlighted',
])) {
if (version_compare(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getExtensionVersion('sg_seo'), '5.0.0', '>=')) {
$fieldNames = [
'doktype',
'title',
'subtitle',
'description',
'slug',
'tx_projectbase_path_segment',
'tx_projectbase_excludefromsluggeneration',
'tx_sgnews_location',
'tx_sgnews_teaser1_image',
'tx_sgnews_teaser2_image',
'tx_sgnews_tags',
'abstract',
'seo_title',
'canonical_link',
'hidden',
'sys_language_uid',
'tx_languagevisibility_visibility',
'lastUpdated',
'tx_sgnews_date_end',
'tx_sgnews_highlighted',
'tx_sgnews_never_highlighted',
];
} else {
$fieldNames = [
'doktype',
'title',
'subtitle',
'description',
'slug',
'tx_projectbase_path_segment',
'tx_projectbase_excludefromsluggeneration',
'tx_sgnews_location',
'tx_sgnews_teaser1_image',
'tx_sgnews_teaser2_image',
'tx_sgnews_tags',
'abstract',
'tx_projectbase_seo_titletag',
'tx_projectbase_seo_canonicaltag',
'hidden',
'sys_language_uid',
'tx_languagevisibility_visibility',
'lastUpdated',
'tx_sgnews_date_end',
'tx_sgnews_highlighted',
'tx_sgnews_never_highlighted',
];
}
if (!in_array($languageExcludeField, $fieldNames)) {
$GLOBALS['TCA']['pages']['types'][\SGalinski\SgNews\Utility\BackendNewsUtility::NEWS_DOKTYPE]['columnsOverrides'][$languageExcludeField]['l10n_mode'] = 'exclude';
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment