[FEATURE] Add properties changefreq and priority to XML sitemap entries
[Packages/TYPO3.CMS.git] / typo3 / sysext / seo / Configuration / TCA / Overrides / pages.php
1 <?php
2 defined('TYPO3_MODE') or die();
3
4 $openGraphCropConfiguration = [
5 'config' => [
6 'cropVariants' => [
7 'default' => [
8 'disabled' => true,
9 ],
10 'social' => [
11 'title' => 'LLL:EXT:core/Resources/Private/Language/locallang_wizards.xlf:imwizard.crop_variant.social',
12 'coverAreas' => [],
13 'cropArea' => [
14 'x' => '0.0',
15 'y' => '0.0',
16 'width' => '1.0',
17 'height' => '1.0'
18 ],
19 'allowedAspectRatios' => [
20 '1.91:1' => [
21 'title' => 'LLL:EXT:core/Resources/Private/Language/locallang_wizards.xlf:imwizard.ratio.191_1',
22 'value' => 1.91 / 1
23 ],
24 'NaN' => [
25 'title' => 'LLL:EXT:core/Resources/Private/Language/locallang_wizards.xlf:imwizard.ratio.free',
26 'value' => 0.0
27 ],
28 ],
29 'selectedRatio' => '1.91:1',
30 ],
31 ],
32 ],
33 ];
34
35 $tca = [
36 'palettes' => [
37 'seo' => [
38 'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.palettes.seo',
39 'showitem' => 'seo_title;LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.seo_title',
40 ],
41 'robots' => [
42 'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.palettes.robots',
43 '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',
44 ],
45 'canonical' => [
46 'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.palettes.canonical',
47 'showitem' => 'canonical_link',
48 ],
49 'sitemap' => [
50 'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.palettes.sitemap',
51 'showitem' => 'sitemap_changefreq, sitemap_priority',
52 ],
53 'opengraph' => [
54 'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.palettes.opengraph',
55 'showitem' => 'og_title, --linebreak--, og_description, --linebreak--, og_image',
56 ],
57 'twittercards' => [
58 'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.palettes.twittercards',
59 'showitem' => 'twitter_title, --linebreak--, twitter_description, --linebreak--, twitter_image',
60 ],
61 ],
62 'columns' => [
63 'seo_title' => [
64 'exclude' => true,
65 'l10n_mode' => 'prefixLangTitle',
66 'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.seo_title',
67 'config' => [
68 'type' => 'input',
69 'size' => 40,
70 'max' => 255,
71 'eval' => 'trim'
72 ]
73 ],
74 'no_index' => [
75 'exclude' => true,
76 'l10n_mode' => 'exclude',
77 'onChange' => 'reload',
78 'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.no_index',
79 'config' => [
80 'type' => 'check',
81 'renderType' => 'checkboxToggle',
82 'items' => [
83 [
84 '0' => '',
85 '1' => '',
86 'invertStateDisplay' => true
87 ]
88 ]
89 ]
90 ],
91 'no_follow' => [
92 'exclude' => true,
93 'l10n_mode' => 'exclude',
94 'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.no_follow',
95 'config' => [
96 'type' => 'check',
97 'renderType' => 'checkboxToggle',
98 'items' => [
99 [
100 '0' => '',
101 '1' => '',
102 'invertStateDisplay' => true
103 ]
104 ]
105 ]
106 ],
107 'sitemap_changefreq' => [
108 'exclude' => true,
109 'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.sitemap_changefreq',
110 'config' => [
111 'type' => 'select',
112 'renderType' => 'selectSingle',
113 'items' => [
114 ['LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.sitemap_changefreq.none', ''],
115 ['LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.sitemap_changefreq.always', 'always'],
116 ['LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.sitemap_changefreq.hourly', 'hourly'],
117 ['LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.sitemap_changefreq.daily', 'daily'],
118 ['LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.sitemap_changefreq.weekly', 'weekly'],
119 ['LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.sitemap_changefreq.monthly', 'monthly'],
120 ['LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.sitemap_changefreq.yearly', 'yearly'],
121 ['LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.sitemap_changefreq.never', 'never'],
122 ],
123 ]
124 ],
125 'sitemap_priority' => [
126 'exclude' => true,
127 'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.sitemap_priority',
128 'config' => [
129 'type' => 'select',
130 'renderType' => 'selectSingle',
131 'items' => [
132 ['0.0', '0.0'],
133 ['0.1', '0.1'],
134 ['0.2', '0.2'],
135 ['0.3', '0.3'],
136 ['0.4', '0.4'],
137 ['0.5', '0.5'],
138 ['0.6', '0.6'],
139 ['0.7', '0.7'],
140 ['0.8', '0.8'],
141 ['0.9', '0.9'],
142 ['1.0', '1.0'],
143 ],
144 ]
145 ],
146 'canonical_link' => [
147 'exclude' => true,
148 'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.canonical_link',
149 'displayCond' => 'FIELD:no_index:=:0',
150 'config' => [
151 'type' => 'input',
152 'renderType' => 'inputLink',
153 'size' => 50,
154 'max' => 1024,
155 'eval' => 'trim',
156 'fieldControl' => [
157 'linkPopup' => [
158 'options' => [
159 'title' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.canonical_link',
160 'blindLinkFields' => 'class,target,title',
161 'blindLinkOptions' => 'mail,folder,file'
162 ],
163 ],
164 ],
165 'softref' => 'typolink'
166 ]
167 ],
168 'og_title' => [
169 'exclude' => true,
170 'l10n_mode' => 'prefixLangTitle',
171 'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.og_title',
172 'config' => [
173 'type' => 'input',
174 'size' => 40,
175 'max' => 255,
176 'eval' => 'trim'
177 ]
178 ],
179 'og_description' => [
180 'exclude' => true,
181 'l10n_mode' => 'prefixLangTitle',
182 'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.og_description',
183 'config' => [
184 'type' => 'text',
185 'cols' => 40,
186 'rows' => 3
187 ]
188 ],
189 'og_image' => [
190 'exclude' => true,
191 'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.og_image',
192 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
193 'og_image',
194 [
195 // Use the imageoverlayPalette instead of the basicoverlayPalette
196 'overrideChildTca' => [
197 'types' => [
198 '0' => [
199 'showitem' => '
200 --palette--;;imageoverlayPalette,
201 --palette--;;filePalette'
202 ],
203 \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
204 'showitem' => '
205 --palette--;;imageoverlayPalette,
206 --palette--;;filePalette'
207 ]
208 ],
209 'columns' => [
210 'crop' => $openGraphCropConfiguration
211 ]
212 ],
213 'behaviour' => [
214 'allowLanguageSynchronization' => true
215 ]
216 ],
217 $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
218 )
219 ],
220 'twitter_title' => [
221 'exclude' => true,
222 'l10n_mode' => 'prefixLangTitle',
223 'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.twitter_title',
224 'config' => [
225 'type' => 'input',
226 'size' => 40,
227 'max' => 255,
228 'eval' => 'trim'
229 ]
230 ],
231 'twitter_description' => [
232 'exclude' => true,
233 'l10n_mode' => 'prefixLangTitle',
234 'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.twitter_description',
235 'config' => [
236 'type' => 'text',
237 'cols' => 40,
238 'rows' => 3
239 ]
240 ],
241 'twitter_image' => [
242 'exclude' => true,
243 'label' => 'LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.twitter_image',
244 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
245 'twitter_image',
246 [
247 // Use the imageoverlayPalette instead of the basicoverlayPalette
248 'overrideChildTca' => [
249 'types' => [
250 '0' => [
251 'showitem' => '
252 --palette--;;imageoverlayPalette,
253 --palette--;;filePalette'
254 ],
255 \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
256 'showitem' => '
257 --palette--;;imageoverlayPalette,
258 --palette--;;filePalette'
259 ]
260 ],
261 'columns' => [
262 'crop' => $openGraphCropConfiguration
263 ]
264 ],
265 'behaviour' => [
266 'allowLanguageSynchronization' => true
267 ]
268 ],
269 $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
270 )
271 ],
272 ],
273 ];
274
275 $GLOBALS['TCA']['pages'] = array_replace_recursive($GLOBALS['TCA']['pages'], $tca);
276 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
277 'pages',
278 '
279 --div--;LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.tabs.seo,
280 --palette--;;seo,
281 --palette--;;robots,
282 --palette--;;canonical,
283 --palette--;;sitemap,
284 --div--;LLL:EXT:seo/Resources/Private/Language/locallang_tca.xlf:pages.tabs.socialmedia,
285 --palette--;;opengraph,
286 --palette--;;twittercards',
287 (string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_DEFAULT,
288 'after:title'
289 );