generated from gitea_admin/default
home cards
This commit is contained in:
@@ -97,36 +97,38 @@
|
||||
// CONTENUS DES CARTES
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
const { items: homeTousOrchestre } = useStrapi(
|
||||
"/api/__strapi__/home-tous-orchestre",
|
||||
const { items: homeCardsTousOrchestre } = useStrapi(
|
||||
"/api/__strapi__/home-cards",
|
||||
{
|
||||
locale: "fr-FR",
|
||||
populate: {
|
||||
carte: {
|
||||
illustration: true,
|
||||
illustration: true,
|
||||
},
|
||||
filters: {
|
||||
type: {
|
||||
$eq: "Tous à l'orchestre",
|
||||
},
|
||||
},
|
||||
limit: 1,
|
||||
sort: "ordre:asc",
|
||||
pageSize: 100,
|
||||
}
|
||||
)
|
||||
|
||||
const homeTousOrchestreContent = computed(() => homeTousOrchestre.value?.[0] || null)
|
||||
|
||||
const cards = computed(() => {
|
||||
const cartes = homeTousOrchestreContent.value?.carte || []
|
||||
const publishedCards = cartes.filter((carte) => carte.publication !== false)
|
||||
const publishedCards = homeCardsTousOrchestre.value.filter((carte) => carte.publication !== false)
|
||||
|
||||
return publishedCards.map((carte, index) => {
|
||||
const image = getStrapiCardImage(carte)
|
||||
const category = carte.categorie || ""
|
||||
const title = carte.titre || ""
|
||||
|
||||
return {
|
||||
id: carte.id || String(index + 1),
|
||||
imgSrc: image?.url || "",
|
||||
imgAlt: image?.alternativeText || image?.caption || carte.titre || "",
|
||||
imgAlt: image?.alternativeText || image?.caption || title,
|
||||
imgWidth: image?.width || undefined,
|
||||
imgHeight: image?.height || undefined,
|
||||
title: carte.titre || "",
|
||||
title,
|
||||
descriptionBlocks: carte.description || null,
|
||||
tags: category ? [category] : [],
|
||||
url: carte.url || "",
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<!-- Content -->
|
||||
<div class="concert-card__content">
|
||||
<NuxtLink v-if="href" :to="href" class="concert-card__link">
|
||||
<DsHeading as="h4" tone="default" class="concert-card__title">
|
||||
<DsHeading as="h4" tone="default" class="concert-card__title uppercase">
|
||||
{{ title }}
|
||||
</DsHeading>
|
||||
</NuxtLink>
|
||||
|
||||
Reference in New Issue
Block a user