From 9eab40424061acd02edb05c2d825773ba3ef77a4 Mon Sep 17 00:00:00 2001 From: Peter Meier Date: Sat, 25 Apr 2026 10:54:05 +0200 Subject: [PATCH] fix(post-overview): hide block entirely when no posts + no intro text The post_overview block kept rendering its

headline + the "all posts" footer link even when both `postsResolved` was empty and `text` was unset, leaving a heading with nothing under it on pages like /mediathek that include the block defensively. Wrap the whole render in `{#if hasContent}` so empty overviews disappear; the heading reappears as soon as posts or intro text are present. --- src/lib/components/blocks/PostOverviewBlock.svelte | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/components/blocks/PostOverviewBlock.svelte b/src/lib/components/blocks/PostOverviewBlock.svelte index 675e786..be39f8a 100644 --- a/src/lib/components/blocks/PostOverviewBlock.svelte +++ b/src/lib/components/blocks/PostOverviewBlock.svelte @@ -20,8 +20,13 @@ const posts = $derived((block.postsResolved ?? []) as (PostEntry & { _resolvedImageUrl?: string })[]); const design = $derived(block.design || "cards"); const tagBase = "/posts/tag"; + // Hide the entire block (headline, intro, footer link) when there are no + // posts and no intro text — otherwise an empty section with just a heading + // sits on the page. + const hasContent = $derived(posts.length > 0 || textHtml.length > 0); +{#if hasContent}
{/if}
+{/if}