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:
@@ -5,6 +5,8 @@
|
||||
import { navigate } from "svelte-routing"
|
||||
|
||||
import Image from "../widgets/Image.svelte"
|
||||
import ArticlesList from "../widgets/ArticlesList.svelte"
|
||||
// import Article from "../widgets/Article.svelte"
|
||||
|
||||
export let path: string
|
||||
|
||||
@@ -13,7 +15,7 @@
|
||||
let connectedContentNotFound: boolean = false
|
||||
$: currentDomain = window.location.protocol + "//" + window.location.host
|
||||
|
||||
const load = (type?: string) => {
|
||||
const loadContent = (type?: string) => {
|
||||
// Set default API call filter
|
||||
let filter = {
|
||||
locale: $currentLang,
|
||||
@@ -45,6 +47,7 @@
|
||||
if (type === "changedLanguage") {
|
||||
let newPath = c.path + $location.search
|
||||
window.history.pushState({}, document.getElementsByTagName("title")[0].innerHTML, newPath)
|
||||
path = newPath
|
||||
}
|
||||
|
||||
connectedContentNotFound = false
|
||||
@@ -69,11 +72,11 @@
|
||||
|
||||
currentLang.subscribe(() => {
|
||||
if (content) {
|
||||
load("changedLanguage")
|
||||
loadContent("changedLanguage")
|
||||
}
|
||||
})
|
||||
|
||||
$: if (path) load()
|
||||
$: if (path) loadContent()
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
@@ -86,11 +89,12 @@
|
||||
{#if loading}
|
||||
<!-- Loader -->
|
||||
{:else if content}
|
||||
<!-- {JSON.stringify(content)} -->
|
||||
<!--
|
||||
{#each content.blocks || [] as b}
|
||||
<h1>{b.article.content.title}</h1>
|
||||
{JSON.stringify(b)}
|
||||
{/each}
|
||||
-->
|
||||
<ArticlesList path="{path}" />
|
||||
{:else}
|
||||
<div class="page-404">
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user