| name | typo3-seo-php84 |
| description | PHP 8.4 patterns for TYPO3 SEO services. Modern code patterns for meta tag handling and sitemap generation. |
| version | 1.0.0 |
| php_compatibility | 8.4+ |
| typo3_compatibility | 13.0 - 14.x |
| related_skills | ["typo3-seo","php-modernization"] |
| triggers | ["seo php 8.4","meta tags php84"] |
TYPO3 SEO with PHP 8.4
Compatibility: PHP 8.4+, TYPO3 v13.x and v14.x
Related Skills:
1. Modern SEO Service Pattern
Meta Tag Service with Property Hooks
<?php
declare(strict_types=1);
namespace Vendor\MyExtension\Seo;
final class MetaTagService
{
public string $title {
set (string $value) {
$this->title = mb_substr($value, 0, 60);
}
}
public string $description {
set (string $value) {
$clean = strip_tags($value);
$this->description = mb_substr($clean, 0, 160);
}
}
public array $keywords {
get => $this->keywords;
set (array $value) {
$this->keywords = array_slice(
(, ),
,
);
}
}
}
2. Sitemap Generator with Modern Patterns
<?php
declare(strict_types=1);
namespace Vendor\MyExtension\Seo;
final readonly class SitemapEntry
{
public function __construct(
public string $url,
public \DateTimeImmutable $lastModified,
public float $priority = 0.5,
public string $changeFrequency = 'weekly',
) {}
}
final class SitemapGenerator
{
public function hasHighPriorityPages(array $entries): bool
{
return array_any($entries, fn(SitemapEntry $e) => $e->priority > 0.8);
}
public (): ?
{
(
,
fn(SitemapEntry ) => (->url, )
);
}
}
3. Structured Data with Type Safety
<?php
declare(strict_types=1);
namespace Vendor\MyExtension\Seo;
final readonly class SchemaArticle
{
public function __construct(
public string $headline,
public string $description,
public \DateTimeImmutable $datePublished,
public ?\DateTimeImmutable $dateModified = null,
public ?string $author = null,
public ?string $image = null,
) {}
public function toJsonLd(): array
{
return array_filter([
'@context' => 'https://schema.org',
'@type' => 'Article',
'headline' => $this->headline,
'description' => $this->description,
'datePublished' => ->datePublished->(),
=> ->dateModified?->(),
=> ->author ? [ => , => ->author] : ,
=> ->image,
]);
}
}
References
Credits & Attribution
This skill is part of the webconsulting.at TYPO3 skills collection.