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:
@@ -4,11 +4,15 @@
|
||||
|
||||
import TibiArticleMediaFile from "./TibiArticleMediaFile.svelte"
|
||||
|
||||
export let entry: CollectionEntry
|
||||
export let entry: CollectionEntry = null
|
||||
export let cssClass: string = ""
|
||||
export let showDetails: boolean = false
|
||||
|
||||
let article = entry.article
|
||||
let article = null
|
||||
if (entry) {
|
||||
article = entry.article
|
||||
}
|
||||
|
||||
let marginClasses: string = ""
|
||||
let paddingClasses: string = ""
|
||||
let published: boolean = true
|
||||
@@ -61,7 +65,7 @@
|
||||
</script>
|
||||
|
||||
{#if article && published}
|
||||
<article class="{cssClass} {article?.layout?.variant} {marginClasses} {paddingClasses}" transition:fade>
|
||||
<article class="{cssClass} {article?.layout?.variant} {marginClasses} {paddingClasses}">
|
||||
{#if article?.layout?.variant === "top"}
|
||||
{#if article?.content?.types?.media?.files?.length}
|
||||
<TibiArticleMediaFile
|
||||
|
||||
@@ -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
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user