Web-Frontend: Kartenkomponenten auf PressRelease-Helper umgestellt (R4.3)
@php-Bloecke von feed-item, feed-top-item, focus-side-item, focus-hero, kategorie, newsroom, release-detail, veroeffentlichen nutzen die neuen Model-Helper — gerendertes Markup unveraendert (Web-Suite 215 gruen). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
01e175e138
commit
3843e534da
8 changed files with 27 additions and 50 deletions
|
|
@ -24,15 +24,12 @@
|
|||
$leadImage = $leadRelease?->images->first();
|
||||
$leadImageUrl = $leadImage?->variantUrl('detail') ?? $leadImage?->variantUrl('card') ?? $leadImage?->url();
|
||||
$leadPlaceholderUrl = $leadImageUrl ? null : $leadRelease?->chosenPlaceholderUrl();
|
||||
$leadCat = $leadRelease?->category?->translations->firstWhere('locale', app()->getLocale()) ?? $leadRelease?->category?->translations->first();
|
||||
$leadCatName = $leadRelease?->localizedCategoryName();
|
||||
$leadCompany = $leadRelease?->company?->name;
|
||||
$leadLead = $leadRelease
|
||||
? (filled($leadRelease->subtitle)
|
||||
? $leadRelease->subtitle
|
||||
: (string) Str::of(strip_tags((string) $leadRelease->text))->squish()->limit(220))
|
||||
? (filled($leadRelease->subtitle) ? $leadRelease->subtitle : $leadRelease->teaserText(220))
|
||||
: null;
|
||||
$leadWords = $leadRelease ? str_word_count(strip_tags((string) $leadRelease->text)) : 0;
|
||||
$leadReadTime = max(1, (int) round($leadWords / 200));
|
||||
$leadReadTime = $leadRelease?->readTimeMinutes() ?? 1;
|
||||
@endphp
|
||||
|
||||
@section('title', __('web.category.meta_title', ['category' => $catName, 'brand' => config('app.name')]))
|
||||
|
|
@ -135,8 +132,8 @@
|
|||
<span class="bp-tag">{{ __('web.hero.top_story') }}</span>
|
||||
</div>
|
||||
<div class="absolute left-0 right-0 bottom-0 px-6 sm:px-9 pb-8 pt-[70px] text-white" style="background:linear-gradient(180deg,transparent,rgba(0,0,0,0.92));">
|
||||
@if ($leadCat)
|
||||
<div class="eyebrow mb-3" style="color:#FF8B6F;">{{ $leadCat->name }}</div>
|
||||
@if ($leadCatName)
|
||||
<div class="eyebrow mb-3" style="color:#FF8B6F;">{{ $leadCatName }}</div>
|
||||
@endif
|
||||
<h2 class="font-serif text-[26px] sm:text-[32px] font-semibold m-0 leading-[1.12] tracking-[-0.6px] max-w-[680px] group-hover:text-white">
|
||||
{{ $leadRelease->title }}
|
||||
|
|
|
|||
|
|
@ -25,14 +25,11 @@
|
|||
$leadImage = $leadRelease?->images->first();
|
||||
$leadImageUrl = $leadImage?->variantUrl('detail') ?? $leadImage?->variantUrl('card') ?? $leadImage?->url();
|
||||
$leadPlaceholderUrl = $leadImageUrl ? null : $leadRelease?->chosenPlaceholderUrl();
|
||||
$leadCat = $leadRelease?->category?->translations->firstWhere('locale', app()->getLocale()) ?? $leadRelease?->category?->translations->first();
|
||||
$leadCatName = $leadRelease?->localizedCategoryName();
|
||||
$leadLead = $leadRelease
|
||||
? (filled($leadRelease->subtitle)
|
||||
? $leadRelease->subtitle
|
||||
: (string) Str::of(strip_tags((string) $leadRelease->text))->squish()->limit(220))
|
||||
? (filled($leadRelease->subtitle) ? $leadRelease->subtitle : $leadRelease->teaserText(220))
|
||||
: null;
|
||||
$leadWords = $leadRelease ? str_word_count(strip_tags((string) $leadRelease->text)) : 0;
|
||||
$leadReadTime = max(1, (int) round($leadWords / 200));
|
||||
$leadReadTime = $leadRelease?->readTimeMinutes() ?? 1;
|
||||
@endphp
|
||||
|
||||
@section('title', $company->name.' – Newsroom · '.$brandName.$brandAccent)
|
||||
|
|
@ -164,8 +161,8 @@
|
|||
<span class="bp-tag">{{ __('web.newsroom_page.latest') }}</span>
|
||||
</div>
|
||||
<div class="absolute left-0 right-0 bottom-0 px-6 sm:px-9 pb-8 pt-[70px] text-white" style="background:linear-gradient(180deg,transparent,rgba(0,0,0,0.92));">
|
||||
@if ($leadCat)
|
||||
<div class="eyebrow mb-3" style="color:#FF8B6F;">{{ $leadCat->name }}</div>
|
||||
@if ($leadCatName)
|
||||
<div class="eyebrow mb-3" style="color:#FF8B6F;">{{ $leadCatName }}</div>
|
||||
@endif
|
||||
<h2 class="font-serif text-[26px] sm:text-[34px] font-semibold m-0 leading-[1.12] tracking-[-0.6px] max-w-[760px] group-hover:text-white">
|
||||
{{ $leadRelease->title }}
|
||||
|
|
|
|||
|
|
@ -29,10 +29,10 @@
|
|||
$embargoAt = $release->embargoAtLocal();
|
||||
|
||||
$bodyHtml = $release->renderedText();
|
||||
$wordCount = str_word_count(strip_tags((string) $release->text));
|
||||
$readTime = max(1, (int) round($wordCount / 200));
|
||||
$wordCount = $release->wordCount();
|
||||
$readTime = $release->readTimeMinutes();
|
||||
|
||||
$teaser = (string) Str::of(strip_tags((string) $release->text))->squish()->limit(180);
|
||||
$teaser = $release->teaserText(180);
|
||||
|
||||
// Subline nur bei explizit gesetztem Untertitel — kein Fallback auf den Textanfang,
|
||||
// sonst erscheint der erste Absatz doppelt. Der Teaser dient nur der Meta-Description.
|
||||
|
|
|
|||
|
|
@ -20,9 +20,7 @@
|
|||
$exampleCategory = $example?->category?->translations?->first()?->name;
|
||||
$exampleCompany = $example?->company?->name;
|
||||
$examplePublishedAt = $example?->published_at;
|
||||
$exampleReadMinutes = $example
|
||||
? max(1, (int) ceil(str_word_count(strip_tags((string) $example->text)) / 200))
|
||||
: 3;
|
||||
$exampleReadMinutes = $example?->readTimeMinutes() ?? 3;
|
||||
|
||||
// Inhalte aus static.publish.* — Reihen als Datenstrukturen (DRY).
|
||||
$trustPrinciples = [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue