4d15c9fd53a007895c78e84df489ba902f9e5e72
[Packages/TYPO3.CMS.git] / typo3 / sysext / seo / Configuration / TCA / Overrides / pages.php
1 <?php
2 defined('TYPO3_MODE') or die();
3
4 $tca = [
5 'palettes' => [
6 'seo' => [
7 'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.palettes.seo',
8 'showitem' => 'seo_title;LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.seo_title',
9 ],
10 'robots' => [
11 'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.palettes.robots',
12 'showitem' => 'no_index;LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.no_index_formlabel, no_follow;LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.no_follow_formlabel',
13 ],
14 'canonical' => [
15 'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.palettes.canonical',
16 'showitem' => 'canonical_link',
17 ],
18 'opengraph' => [
19 'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.palettes.opengraph',
20 'showitem' => 'og_title, --linebreak--, og_description, --linebreak--, og_image',
21 ],
22 'twittercards' => [
23 'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.palettes.twittercards',
24 'showitem' => 'twitter_title, --linebreak--, twitter_description, --linebreak--, twitter_image',
25 ],
26 ],
27 'columns' => [
28 'seo_title' => [
29 'exclude' => true,
30 'l10n_mode' => 'prefixLangTitle',
31 'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.seo_title',
32 'config' => [
33 'type' => 'input',
34 'size' => 40,
35 'max' => 255,
36 'eval' => 'trim'
37 ]
38 ],
39 'no_index' => [
40 'exclude' => true,
41 'l10n_mode' => 'exclude',
42 'onChange' => 'reload',
43 'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.no_index',
44 'config' => [
45 'type' => 'check',
46 'renderType' => 'checkboxToggle',
47 'items' => [
48 [
49 '0' => '',
50 '1' => '',
51 'invertStateDisplay' => true
52 ]
53 ]
54 ]
55 ],
56 'no_follow' => [
57 'exclude' => true,
58 'l10n_mode' => 'exclude',
59 'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.no_follow',
60 'config' => [
61 'type' => 'check',
62 'renderType' => 'checkboxToggle',
63 'items' => [
64 [
65 '0' => '',
66 '1' => '',
67 'invertStateDisplay' => true
68 ]
69 ]
70 ]
71 ],
72 'canonical_link' => [
73 'exclude' => true,
74 'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.canonical_link',
75 'displayCond' => 'FIELD:no_index:=:0',
76 'config' => [
77 'type' => 'input',
78 'renderType' => 'inputLink',
79 'size' => 50,
80 'max' => 1024,
81 'eval' => 'trim',
82 'fieldControl' => [
83 'linkPopup' => [
84 'options' => [
85 'title' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.canonical_link',
86 'blindLinkFields' => 'class,target,title',
87 'blindLinkOptions' => 'mail,folder,file'
88 ],
89 ],
90 ],
91 'softref' => 'typolink'
92 ]
93 ],
94 'og_title' => [
95 'exclude' => true,
96 'l10n_mode' => 'prefixLangTitle',
97 'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.og_title',
98 'config' => [
99 'type' => 'input',
100 'size' => 40,
101 'max' => 255,
102 'eval' => 'trim'
103 ]
104 ],
105 'og_description' => [
106 'exclude' => true,
107 'l10n_mode' => 'prefixLangTitle',
108 'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.og_description',
109 'config' => [
110 'type' => 'text',
111 'cols' => 40,
112 'rows' => 3
113 ]
114 ],
115 'og_image' => [
116 'exclude' => true,
117 'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.og_image',
118 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
119 'og_image',
120 [
121 // Use the imageoverlayPalette instead of the basicoverlayPalette
122 'overrideChildTca' => [
123 'types' => [
124 '0' => [
125 'showitem' => '
126 --palette--;;imageoverlayPalette,
127 --palette--;;filePalette'
128 ],
129 \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
130 'showitem' => '
131 --palette--;;imageoverlayPalette,
132 --palette--;;filePalette'
133 ]
134 ],
135 ],
136 'behaviour' => [
137 'allowLanguageSynchronization' => true
138 ]
139 ],
140 $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
141 )
142 ],
143 'twitter_title' => [
144 'exclude' => true,
145 'l10n_mode' => 'prefixLangTitle',
146 'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.twitter_title',
147 'config' => [
148 'type' => 'input',
149 'size' => 40,
150 'max' => 255,
151 'eval' => 'trim'
152 ]
153 ],
154 'twitter_description' => [
155 'exclude' => true,
156 'l10n_mode' => 'prefixLangTitle',
157 'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.twitter_description',
158 'config' => [
159 'type' => 'text',
160 'cols' => 40,
161 'rows' => 3
162 ]
163 ],
164 'twitter_image' => [
165 'exclude' => true,
166 'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.twitter_image',
167 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
168 'twitter_image',
169 [
170 // Use the imageoverlayPalette instead of the basicoverlayPalette
171 'overrideChildTca' => [
172 'types' => [
173 '0' => [
174 'showitem' => '
175 --palette--;;imageoverlayPalette,
176 --palette--;;filePalette'
177 ],
178 \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
179 'showitem' => '
180 --palette--;;imageoverlayPalette,
181 --palette--;;filePalette'
182 ]
183 ],
184 ],
185 'behaviour' => [
186 'allowLanguageSynchronization' => true
187 ]
188 ],
189 $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
190 )
191 ],
192 ],
193 ];
194
195 $GLOBALS['TCA']['pages'] = array_replace_recursive($GLOBALS['TCA']['pages'], $tca);
196 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
197 'pages',
198 '
199 --div--;LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.tabs.seo,
200 --palette--;;seo,
201 --palette--;;robots,
202 --palette--;;canonical,
203 --div--;LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.tabs.socialmedia,
204 --palette--;;opengraph,
205 --palette--;;twittercards',
206 (string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_DEFAULT,
207 'after:title'
208 );