Add inspirations blueprints, template and views
This commit is contained in:
parent
d1c108a2d6
commit
1183905251
7 changed files with 107 additions and 1 deletions
45
public/site/blueprints/pages/inspiration.yml
Normal file
45
public/site/blueprints/pages/inspiration.yml
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
title: Inspiration
|
||||||
|
icon: images
|
||||||
|
|
||||||
|
status:
|
||||||
|
draft: true
|
||||||
|
unlisted: false
|
||||||
|
listed: true
|
||||||
|
|
||||||
|
tabs:
|
||||||
|
content:
|
||||||
|
label: Contenu
|
||||||
|
icon: dashboard
|
||||||
|
columns:
|
||||||
|
- width: 1/1
|
||||||
|
sections:
|
||||||
|
content:
|
||||||
|
type: fields
|
||||||
|
fields:
|
||||||
|
cover:
|
||||||
|
type: files
|
||||||
|
multiple: false
|
||||||
|
layout: cards
|
||||||
|
size: full
|
||||||
|
image:
|
||||||
|
ratio: 6/1
|
||||||
|
cover: true
|
||||||
|
date:
|
||||||
|
type: date
|
||||||
|
display: YY/MM
|
||||||
|
required: true
|
||||||
|
width: 2/12
|
||||||
|
new:
|
||||||
|
label: Nouveauté
|
||||||
|
type: toggle
|
||||||
|
width: 1/12
|
||||||
|
description:
|
||||||
|
type: text
|
||||||
|
required: true
|
||||||
|
width: 9/12
|
||||||
|
media:
|
||||||
|
type: files
|
||||||
|
layout: cards
|
||||||
|
size: large
|
||||||
|
required: true
|
||||||
|
files: tabs/files
|
||||||
11
public/site/blueprints/pages/inspirations.yml
Normal file
11
public/site/blueprints/pages/inspirations.yml
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
title: Inspirations
|
||||||
|
|
||||||
|
sections:
|
||||||
|
drafts:
|
||||||
|
extends: sections/inspirations
|
||||||
|
headline: Brouillons
|
||||||
|
status: draft
|
||||||
|
listed:
|
||||||
|
extends: sections/inspirations
|
||||||
|
headline: Publiées
|
||||||
|
status: listed
|
||||||
22
public/site/blueprints/sections/inspirations.yml
Normal file
22
public/site/blueprints/sections/inspirations.yml
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
type: pages
|
||||||
|
headline: Inspirations
|
||||||
|
template: inspiration
|
||||||
|
layout: table
|
||||||
|
columns:
|
||||||
|
title:
|
||||||
|
label: Titre
|
||||||
|
width: 3/12
|
||||||
|
date:
|
||||||
|
label: Date
|
||||||
|
value: "{{ page.date.toDate('YY/MM') }}"
|
||||||
|
width: 1/12
|
||||||
|
new:
|
||||||
|
label: Nouveauté
|
||||||
|
width: 1/12
|
||||||
|
description:
|
||||||
|
width: 7/12
|
||||||
|
empty: Pas encore d’inspiration
|
||||||
|
image:
|
||||||
|
query: page.cover.toFile
|
||||||
|
cover: true
|
||||||
|
search: true
|
||||||
10
public/site/templates/inspirations.json.php
Normal file
10
public/site/templates/inspirations.json.php
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$specificData = [
|
||||||
|
"exampleField" => $page->exampleField(),
|
||||||
|
"exampleHardData" => 'Example hard value'
|
||||||
|
];
|
||||||
|
|
||||||
|
$data = array_merge($genericData, $specificData);
|
||||||
|
|
||||||
|
echo json_encode($data);
|
||||||
1
public/site/templates/inspirations.php
Normal file
1
public/site/templates/inspirations.php
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
<?php snippet('generic-template') ?>
|
||||||
|
|
@ -6,9 +6,10 @@
|
||||||
import { useApiStore } from "./stores/api";
|
import { useApiStore } from "./stores/api";
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import home from "./views/Home.vue";
|
import home from "./views/Home.vue";
|
||||||
|
import inspirations from "./views/Inspirations.vue";
|
||||||
|
|
||||||
const components = {
|
const components = {
|
||||||
home,
|
home, inspirations
|
||||||
};
|
};
|
||||||
|
|
||||||
const data = ref(null);
|
const data = ref(null);
|
||||||
|
|
|
||||||
16
src/views/Inspirations.vue
Normal file
16
src/views/Inspirations.vue
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
<template>
|
||||||
|
<h1>{{ data.content.title }}</h1>
|
||||||
|
<!-- ... -->
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
const { data } = defineProps({
|
||||||
|
data: Object,
|
||||||
|
});
|
||||||
|
|
||||||
|
// ....
|
||||||
|
</script>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue