diff --git a/site/blueprints/pages/news.yml b/site/blueprints/pages/news.yml index 7e6168b..2c2ef20 100644 --- a/site/blueprints/pages/news.yml +++ b/site/blueprints/pages/news.yml @@ -13,6 +13,7 @@ columns: fieldsets: - heading - text + - markdown - image - line - gallery @@ -51,6 +52,17 @@ columns: label: Zusammenfassung type: textarea size: small + tags: + label: Tags + type: multiselect + min: 1 + max: 3 + options: + Spielbericht: Spielbericht + Vereinsleben: Vereinsleben + Vereinsmeisterschaft: Vereinsmeisterschaft + Pressebericht: Pressebericht + Turnierbericht: Turnierbericht author: label: Autor type: users diff --git a/site/snippets/home-news.php b/site/snippets/home-news.php new file mode 100644 index 0000000..66256e4 --- /dev/null +++ b/site/snippets/home-news.php @@ -0,0 +1,48 @@ +
+

Neuigkeiten aus dem Verein

+
+ + + +
+
\ No newline at end of file diff --git a/site/snippets/termine-home.php b/site/snippets/home-termine.php similarity index 94% rename from site/snippets/termine-home.php rename to site/snippets/home-termine.php index 66dcb1c..bb92f9c 100644 --- a/site/snippets/termine-home.php +++ b/site/snippets/home-termine.php @@ -107,16 +107,28 @@ // Funktion zum Aktualisieren der Sichtbarkeit der Pfeile function updateArrowVisibility() { - scrollLeftBtn.classList.toggle('opacity-50', currentPosition <= 0); - scrollRightBtn.classList.toggle('opacity-50', currentPosition >= maxPosition); + // Linker Pfeil nur anzeigen, wenn es vorherige Termine gibt + if (currentPosition <= 0) { + scrollLeftBtn.classList.add('hidden'); + } else { + scrollLeftBtn.classList.remove('hidden'); + } + + // Rechter Pfeil nur anzeigen, wenn es weitere Termine gibt + if (currentPosition >= maxPosition) { + scrollRightBtn.classList.add('hidden'); + } else { + scrollRightBtn.classList.remove('hidden'); + } } - // Initialisierung - verstecke die Pfeile wenn weniger als cardsToShow+1 Karten vorhanden sind + // Initialisierung - zeige die Pfeile nur, wenn es genug Karten gibt if (totalCards <= cardsToShow) { scrollLeftBtn.classList.add('hidden'); scrollRightBtn.classList.add('hidden'); } else { - scrollLeftBtn.classList.remove('hidden'); + // Am Anfang ist der linke Pfeil ausgeblendet, da wir bei Position 0 sind + scrollLeftBtn.classList.add('hidden'); scrollRightBtn.classList.remove('hidden'); } @@ -161,14 +173,8 @@ // Position aktualisieren scrollToPosition(); - // Pfeile aktualisieren - if (totalCards <= cardsToShow) { - scrollLeftBtn.classList.add('hidden'); - scrollRightBtn.classList.add('hidden'); - } else { - scrollLeftBtn.classList.remove('hidden'); - scrollRightBtn.classList.remove('hidden'); - } + // Pfeile-Sichtbarkeit aktualisieren + updateArrowVisibility(); }); }); diff --git a/site/templates/blog.php b/site/templates/blog.php index a31c0fd..574b11b 100644 --- a/site/templates/blog.php +++ b/site/templates/blog.php @@ -1,17 +1,33 @@ - children() as $post): ?> -
+ children()->sortBy('date', 'desc'); + + // Nach Kategorie (Tag) filtern + if($tag = param('tag')) { + $posts = $posts->filterBy('tags', $tag, ','); + } + ?> + + +
- +
-
- - Marketing +
+
+ +
+
+ tags()->split() as $tag): ?> + + +
-
+

@@ -26,12 +42,10 @@

- - -

- + +
+ username() ?> +

role()->title() ?>

@@ -41,5 +55,13 @@

+ + +
+ + Alle Beiträge anzeigen + +
+ \ No newline at end of file diff --git a/site/templates/home.php b/site/templates/home.php index e5a8214..d7f2791 100644 --- a/site/templates/home.php +++ b/site/templates/home.php @@ -2,6 +2,13 @@

Hallo Welt!

- + page('news') + ->children() + ->limit(3) + ->sortBy('date', 'desc') + ]) ?> + + \ No newline at end of file diff --git a/site/templates/news.php b/site/templates/news.php index f2c4d05..3026bb3 100644 --- a/site/templates/news.php +++ b/site/templates/news.php @@ -23,12 +23,23 @@ -

date()->toDate("d.m.Y") ?> - subheadline() ?>

+
+ tags()->split() as $tag): ?> + + +
+ +

+ date()->toDate("d.m.Y") ?> + subheadline()->isNotEmpty()): ?> + - subheadline() ?> + +

headline() ?>

- +
@@ -53,5 +64,4 @@
- \ No newline at end of file