@extends('layouts.app') @section('title', $tool['seo_title'] ?? ($tool['name'] . ' | kotsch.tech')) @section('meta_description', $tool['meta_description'] ?? $tool['desc']) @section('meta_extra') @php // Per-tool SEO content (about / examples / faq), keyed by slug, with fallback // to the per-category content so every tool always has rich content. $toolSeo = config('tool_seo_content', [])[$tool['slug']] ?? []; $catContent = config('tool_category_content', [])[$tool['cat']] ?? null; $seoFaq = !empty($toolSeo['faq']) ? $toolSeo['faq'] : ($catContent['faq'] ?? []); @endphp {{-- Canonical wird vom Layout gesetzt (https://webtools.kotsch.tech/) — hier KEIN zweites canonical, sonst doppelt/widersprüchlich (P0-2). --}} @if(!empty($seoFaq)) @endif @endsection @section('content') @include('tools._simple_style') {{ $tool['cat'] }} {{ $tool['name'] }} {{ $tool['intro'] ?? $tool['desc'] }} @if($gated ?? false) @else @foreach($tool['inputs'] as $input) {{ $input['label'] }} @if(($input['type'] ?? 'text') === 'textarea') {{ $input['value'] ?? '' }} @elseif(($input['type'] ?? 'text') === 'select') @foreach($input['options'] ?? [] as $option) @php // Optionen dürfen entweder assoziativ (['value'=>,'label'=>]) // oder als einfacher String vorliegen — beides robust rendern. $optValue = is_array($option) ? ($option['value'] ?? '') : (string) $option; $optLabel = is_array($option) ? ($option['label'] ?? $option['value'] ?? '') : \Illuminate\Support\Str::ucfirst((string) $option); @endphp {{ $optLabel }} @endforeach @else @endif @endforeach Ergebnis berechnen Ergebnis kopieren @endif {{-- ===== Content section: Wozu + Beispiele + Related + Category + FAQ ===== --}} @php // $toolSeo, $catContent, $seoFaq are computed in the meta_extra section above. $relatedTools = collect(config('webtools_extra', [])) ->reject(fn($t) => $t['slug'] === $tool['slug']) ->where('cat', $tool['cat']) ->take(4) ->values(); @endphp @if(!empty($toolSeo['about'])) Wozu dient der {{ $tool['name'] }}? {!! $toolSeo['about'] !!} @endif @if(!empty($toolSeo['examples'])) Beispiele @foreach($toolSeo['examples'] as $ex) {!! $ex !!} @endforeach @endif @if(!empty($seoFaq)) Häufige Fragen zum {{ $tool['name'] }} @foreach($seoFaq as $fq) {{ $fq['q'] }} {{ $fq['a'] }} @endforeach @endif @if($relatedTools->isNotEmpty()) Weitere {{ $tool['cat'] }}-Rechner @foreach($relatedTools as $rt) {{ $rt['name'] }} {{ $rt['desc'] }} @endforeach @endif @if($catContent && empty($toolSeo['about'])) Über {{ $tool['cat'] }}-Tools {!! $catContent['desc'] !!} @endif @include('tools._ads_banner') @unless($gated ?? false) @endunless @endsection
{{ $tool['intro'] ?? $tool['desc'] }}
{{ $fq['a'] }}