News: Canonical auf Success Story (Feld vitec_canonical_usecase), 13 Paare gesetzt

13 Pressemeldungen tragen denselben Text wie eine Success Story
(Seobility: doppelter Inhalt). Neues Feld am News-Datensatz (Tab
'VITEC SEO', Auswahl der Story); VitecMetaHandler ersetzt damit den
Canonical-Link durch /success-stories/<slug>. Die Meldung bleibt in der
Liste, Suchmaschinen werten die Story als Original. Migration
news_story_canonical_20261110 setzt die 13 Zuordnungen (angewendet).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
orascheandClaude Fable 5.1 committed 2026-11-10 18:20:03 +01:00
1 parent f7b1eacecb
commit 4b6731786d
4 files changed
+135

No files matched your search

@@ -0,0 +1,30 @@
<?php
declare(strict_types=1);
defined('TYPO3') or die();
// Canonical story for a news article: when a success story carries the same
// text as the article, the article stays in the news list but its canonical
// link points to the story (VitecMetaHandler reads this field).
(static function (): void {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('tx_news_domain_model_news', [
'vitec_canonical_usecase' => [
'label' => 'Canonical success story',
'description' => 'Set when a success story carries the same text as this article. The article stays in the news list; search engines count the story as the original.',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'foreign_table' => 'tx_vitec_domain_model_usecase',
'foreign_table_where' => 'AND {#tx_vitec_domain_model_usecase}.{#deleted} = 0 ORDER BY tx_vitec_domain_model_usecase.title',
'items' => [['label' => '— none —', 'value' => 0]],
'default' => 0,
'size' => 1,
'maxitems' => 1,
],
],
]);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
'tx_news_domain_model_news',
'--div--;VITEC SEO, vitec_canonical_usecase'
);
})();