Verlinkung zu externen URLs für Article hinzugefügt.

This commit is contained in:
Mario Linz 2022-06-15 08:57:51 +02:00
parent 25a39dfac0
commit 65e8b7ffc8
5 changed files with 52 additions and 12 deletions

View File

@ -45,9 +45,9 @@ meta:
meta:
label: { de: "Allgemein", en: "General" }
subFields:
- source: path
- source: locale
- source: tags
- source: path
- source: priority
- name: meta
meta:
@ -125,6 +125,15 @@ hooks:
# Feldliste der Kollektion
fields:
- name: path
type: string
index: [single, unique]
meta:
hideInRoot: true
label: { de: "Pfad", en: "Path" }
helperText:
de: "Der Pfad muss eindeutig sein und ohne ein Slash (/) beginnen und enden."
en: "The path must be unique and must start and end without a slash (/)."
- !include fields/_locale.yml
- name: tags
type: string[]
@ -145,15 +154,6 @@ fields:
name: "name"
params:
sort: "name"
- name: path
type: string
index: [single, unique]
meta:
hideInRoot: true
label: { de: "Pfad", en: "Path" }
helperText:
de: "Der Pfad muss eindeutig sein und ohne ein Slash (/) beginnen und enden."
en: "The path must be unique and must start and end without a slash (/)."
- name: priority
type: number
meta:

View File

@ -1,5 +1,6 @@
<script lang="ts">
import { fade } from "svelte/transition"
import { _ } from "svelte-i18n"
// import { navigate } from "svelte-routing"
import TibiArticleMediaFile from "./TibiArticleMediaFile.svelte"
@ -86,6 +87,14 @@
<div class="article-teaser">{@html article?.content?.types?.teaser}</div>
{/if}
{#if article?.link?.url}
<a
href="{article?.link?.url}"
target="{article?.link?.target ? article?.link?.target : '_self'}"
class="article-link">{@html article?.link?.text ? article?.link?.text : $_("details")}</a
>
{/if}
{#if article?.content?.types?.details && showDetails}
<div class="article-details">{@html article?.content?.types?.details}</div>
{/if}
@ -104,6 +113,14 @@
<div class="article-teaser">{@html article?.content?.types?.teaser}</div>
{/if}
{#if article?.link?.url}
<a
href="{article?.link?.url}"
target="{article?.link?.target ? article?.link?.target : '_self'}"
class="article-link">{@html article?.link?.text ? article?.link?.text : $_("details")}</a
>
{/if}
{#if article?.content?.types?.details && showDetails}
<div class="article-details">{@html article?.content?.types?.details}</div>
{/if}
@ -131,9 +148,18 @@
<div class="article-teaser">{@html article?.content?.types?.teaser}</div>
{/if}
{#if article?.link?.url}
<a
href="{article?.link?.url}"
target="{article?.link?.target ? article?.link?.target : '_self'}"
class="article-link">{@html article?.link?.text ? article?.link?.text : $_("details")}</a
>
{/if}
{#if article?.content?.types?.details && showDetails}
<div class="article-details">{@html article?.content?.types?.details}</div>
{/if}
{#if article?.content?.types?.media?.files?.length}
<TibiArticleMediaFile
collectionName="articles"
@ -165,6 +191,14 @@
<div class="article-teaser">{@html article?.content?.types?.teaser}</div>
{/if}
{#if article?.link?.url}
<a
href="{article?.link?.url}"
target="{article?.link?.target ? article?.link?.target : '_self'}"
class="article-link">{@html article?.link?.text ? article?.link?.text : $_("details")}</a
>
{/if}
{#if article?.content?.types?.details && showDetails}
<div class="article-details">{@html article?.content?.types?.details}</div>
{/if}

View File

@ -20,4 +20,8 @@ article,
font-size: 1.4rem;
line-height: 1.8rem;
}
.article-link {
text-decoration: underline;
}
}

View File

@ -3,5 +3,6 @@
"pageNotFoundInformation": "Die gesuchte Seite existiert nicht oder es ist ein anderer Fehler aufgetreten.<br/>Gehen Sie <a href=\"{backUrl}\"><strong>zurück</strong></a> oder gehen Sie zu <a href=\"{url}\"><strong>{url}</strong></a>, um eineneue Richtung zu wählen.",
"connectedContentNotFound": "Zur aktuellen Seite <a href=\"{url}\"><strong>{url}</strong></a> wurde für die gewählte Sprache \"<strong>{lang}</strong>\" keine Übersetzung gefunden!",
"de": "Deutsch",
"en": "Englisch"
"en": "Englisch",
"details": "Details"
}

View File

@ -3,5 +3,6 @@
"pageNotFoundInformation": "The page you are looking for doesn't exist or an other error occurred.<br/><a href=\"{backUrl}\"><strong>Go back</strong></a>, or head over to <a href=\"{url}\"><strong>{url}</strong></a> to choose a new direction.",
"connectedContentNotFound": "No translation was found for the selected language \"<strong>{lang}</strong>\" for the current page <a href=\"{url}\"><strong>{url}</strong></a>!",
"de": "German",
"en": "English"
"en": "English",
"details": "Details"
}