Zuweisung von Artikeln zu Seiten möglich. Somit werden keine Content-Blocks mehr benötigt und alle Artikel können über die articles-Collection gepflegt udn zugewiesen werden.

This commit is contained in:
2022-06-14 10:30:40 +02:00
parent 05fe698af6
commit ee7ed0db1f
8 changed files with 42 additions and 30 deletions

View File

@@ -4,17 +4,25 @@
import Article from "../widgets/Article.svelte"
export let tag: string
export let tag: string = null
export let path: string = null
let articleEntries: CollectionEntry[] = []
$: if ($currentLang) {
getArticles("articles", {
filter: {
"article.general.locale": $currentLang,
"article.general.tags": { $in: [tag] },
},
}).then((response) => {
let filter = {
"article.general.locale": $currentLang,
}
if (tag) {
filter["article.general.tags"] = { $in: [tag] }
}
if (path) {
filter["article.general.pages"] = { $in: [path] }
}
getArticles("articles", { filter }).then((response) => {
articleEntries = response
})
}