blueprints
This commit is contained in:
parent
b35bee4fe3
commit
b8cb77c0e5
52 changed files with 752 additions and 6 deletions
60
public/site/blueprints/blocks/image.yml
Normal file
60
public/site/blueprints/blocks/image.yml
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
name: field.blocks.image.name
|
||||
icon: image
|
||||
preview: image
|
||||
fields:
|
||||
location:
|
||||
label: field.blocks.image.location
|
||||
type: radio
|
||||
columns: 2
|
||||
default: "kirby"
|
||||
options:
|
||||
kirby: "{{ t('field.blocks.image.location.internal') }}"
|
||||
web: "{{ t('field.blocks.image.location.external') }}"
|
||||
image:
|
||||
label: field.blocks.image.name
|
||||
type: files
|
||||
query: model.images
|
||||
multiple: false
|
||||
image:
|
||||
back: black
|
||||
uploads:
|
||||
template: blocks/image
|
||||
when:
|
||||
location: kirby
|
||||
src:
|
||||
label: field.blocks.image.url
|
||||
type: url
|
||||
when:
|
||||
location: web
|
||||
alt:
|
||||
label: field.blocks.image.alt
|
||||
type: text
|
||||
icon: title
|
||||
caption:
|
||||
label: field.blocks.image.caption
|
||||
type: writer
|
||||
icon: text
|
||||
inline: true
|
||||
link:
|
||||
label: field.blocks.image.link
|
||||
type: text
|
||||
icon: url
|
||||
width:
|
||||
label: Largeur de l'image
|
||||
type: select
|
||||
width: 1/2
|
||||
options:
|
||||
16.666%: "16.666%"
|
||||
20%: "20%"
|
||||
25%: "25%"
|
||||
33.333%: "33.333%"
|
||||
50%: "50%"
|
||||
66.666%: "66.666%"
|
||||
100%: "100%"
|
||||
position:
|
||||
label: Position de l'image
|
||||
type: select
|
||||
width: 1/2
|
||||
options:
|
||||
auto: "Centrée"
|
||||
0: "Alignée à gauche"
|
||||
8
public/site/blueprints/blocks/map.yml
Normal file
8
public/site/blueprints/blocks/map.yml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
name: Carte
|
||||
icon: map
|
||||
fields:
|
||||
map:
|
||||
label: Choisir la carte
|
||||
type: pages
|
||||
query: page.parent.parent.children.filterBy('intendedTemplate', 'carte')
|
||||
multiple: false
|
||||
9
public/site/blueprints/blocks/text.yml
Normal file
9
public/site/blueprints/blocks/text.yml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
name: field.blocks.text.name
|
||||
icon: text
|
||||
wysiwyg: true
|
||||
preview: text
|
||||
fields:
|
||||
text:
|
||||
type: writer
|
||||
nodes: true
|
||||
placeholder: field.blocks.text.placeholder
|
||||
39
public/site/blueprints/blocks/video.yml
Normal file
39
public/site/blueprints/blocks/video.yml
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
name: field.blocks.video.name
|
||||
icon: video
|
||||
preview: video
|
||||
fields:
|
||||
# url:
|
||||
# label: field.blocks.video.url.label
|
||||
# type: url
|
||||
# placeholder: field.blocks.video.url.placeholder
|
||||
location:
|
||||
label: field.blocks.image.location
|
||||
type: radio
|
||||
columns: 2
|
||||
default: "kirby"
|
||||
options:
|
||||
kirby: "{{ t('field.blocks.image.location.internal') }}"
|
||||
web: "{{ t('field.blocks.image.location.external') }}"
|
||||
video:
|
||||
label: field.blocks.video.name
|
||||
type: files
|
||||
query: model.videos
|
||||
multiple: false
|
||||
video:
|
||||
back: black
|
||||
uploads:
|
||||
template: blocks/video
|
||||
when:
|
||||
location: kirby
|
||||
url:
|
||||
label: field.blocks.video.url.label
|
||||
type: url
|
||||
placeholder: field.blocks.video.url.placeholder
|
||||
when:
|
||||
location: web
|
||||
caption:
|
||||
label: field.blocks.video.caption
|
||||
type: writer
|
||||
inline: true
|
||||
|
||||
|
||||
30
public/site/blueprints/pages/carte.yml
Normal file
30
public/site/blueprints/pages/carte.yml
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
title: Carte
|
||||
|
||||
columns:
|
||||
main:
|
||||
width: 2/3
|
||||
sections:
|
||||
fields:
|
||||
type: fields
|
||||
fields:
|
||||
tags:
|
||||
label: Mots-clés
|
||||
type: tags
|
||||
text:
|
||||
label: Présentation de la carte
|
||||
type: writer
|
||||
map:
|
||||
label: Carte
|
||||
type: info
|
||||
text: |
|
||||
Ici le plugin pour la carte et les marqueurs
|
||||
Avoir la possibilité de changer le fond de carte en image
|
||||
sidebar:
|
||||
width: 1/3
|
||||
sections:
|
||||
files:
|
||||
label: Fichiers
|
||||
type: files
|
||||
|
||||
|
||||
|
||||
38
public/site/blueprints/pages/chapitre.yml
Normal file
38
public/site/blueprints/pages/chapitre.yml
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
title: Chapitre
|
||||
|
||||
columns:
|
||||
main:
|
||||
width: 2/3
|
||||
sections:
|
||||
fields:
|
||||
type: fields
|
||||
fields:
|
||||
text:
|
||||
label: Contenu
|
||||
type: blocks
|
||||
fieldsets:
|
||||
text:
|
||||
label: Texte
|
||||
type: group
|
||||
fieldsets:
|
||||
- heading
|
||||
- text
|
||||
- list
|
||||
- quote
|
||||
media:
|
||||
label: Medias
|
||||
type: group
|
||||
fieldsets:
|
||||
- map
|
||||
- image
|
||||
- video
|
||||
|
||||
sidebar:
|
||||
width: 1/3
|
||||
sections:
|
||||
files:
|
||||
label: Fichiers
|
||||
type: files
|
||||
|
||||
|
||||
|
||||
38
public/site/blueprints/pages/geoformat.yml
Normal file
38
public/site/blueprints/pages/geoformat.yml
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
title: Géoformat
|
||||
|
||||
columns:
|
||||
main:
|
||||
width: 2/3
|
||||
sections:
|
||||
fields:
|
||||
type: fields
|
||||
fields:
|
||||
subtitle:
|
||||
label: Sous-titre
|
||||
type: text
|
||||
width: 1/2
|
||||
tags:
|
||||
label: Mots-clés
|
||||
type: tags
|
||||
width: 1/2
|
||||
cover:
|
||||
label: Media de couverture
|
||||
type: files
|
||||
multiple: false
|
||||
width: 1/2
|
||||
text:
|
||||
label: Chapeau
|
||||
type: writer
|
||||
pages:
|
||||
label: Chapitres
|
||||
type: pages
|
||||
template: chapitre
|
||||
sidebar:
|
||||
width: 1/3
|
||||
sections:
|
||||
files:
|
||||
label: Fichiers
|
||||
type: files
|
||||
|
||||
|
||||
|
||||
31
public/site/blueprints/pages/projet.yml
Normal file
31
public/site/blueprints/pages/projet.yml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
title: Projet
|
||||
|
||||
columns:
|
||||
main:
|
||||
width: 2/3
|
||||
sections:
|
||||
fields:
|
||||
type: fields
|
||||
fields:
|
||||
subtitle:
|
||||
label: Sous-titre
|
||||
type: text
|
||||
width: 1/2
|
||||
cover:
|
||||
label: Image de couverture
|
||||
type: files
|
||||
multiple: false
|
||||
width: 1/2
|
||||
pages:
|
||||
label: Récits
|
||||
type: pages
|
||||
template: recit
|
||||
sidebar:
|
||||
width: 1/3
|
||||
sections:
|
||||
files:
|
||||
label: Fichiers
|
||||
type: files
|
||||
|
||||
|
||||
|
||||
36
public/site/blueprints/pages/recit.yml
Normal file
36
public/site/blueprints/pages/recit.yml
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
title: Récit
|
||||
|
||||
columns:
|
||||
main:
|
||||
width: 2/3
|
||||
sections:
|
||||
fields:
|
||||
type: fields
|
||||
fields:
|
||||
author:
|
||||
label: Auteur·ice(s)
|
||||
type: text
|
||||
width: 1/2
|
||||
cover:
|
||||
label: Image de couverture
|
||||
type: files
|
||||
multiple: false
|
||||
width: 1/2
|
||||
introduction:
|
||||
label: Introduction
|
||||
type: writer
|
||||
pages:
|
||||
label: Pages
|
||||
type: pages
|
||||
template:
|
||||
- carte
|
||||
- geoformat
|
||||
sidebar:
|
||||
width: 1/3
|
||||
sections:
|
||||
files:
|
||||
label: Fichiers
|
||||
type: files
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,5 +1,82 @@
|
|||
title: Site
|
||||
|
||||
sections:
|
||||
pages:
|
||||
type: pages
|
||||
|
||||
tabs:
|
||||
content:
|
||||
icon: text
|
||||
label: Content
|
||||
columns:
|
||||
main:
|
||||
width: 1/2
|
||||
sections:
|
||||
menu:
|
||||
label: Projets
|
||||
type: pages
|
||||
templates:
|
||||
- projet
|
||||
secondary:
|
||||
width: 1/2
|
||||
sections:
|
||||
pages:
|
||||
type: pages
|
||||
label: Autres pages
|
||||
templates:
|
||||
- home
|
||||
- error
|
||||
settings:
|
||||
label: Paramètres
|
||||
icon: settings
|
||||
columns:
|
||||
main:
|
||||
width: 2/3
|
||||
sections:
|
||||
content:
|
||||
type: fields
|
||||
fields:
|
||||
logo:
|
||||
label: Logo
|
||||
type: files
|
||||
multiple: false
|
||||
width: 1/2
|
||||
cover:
|
||||
label: Image de couverture
|
||||
type: files
|
||||
multiple: false
|
||||
width: 1/2
|
||||
copyright:
|
||||
label: Copyright
|
||||
type: text
|
||||
social:
|
||||
label: Réseaux sociaux
|
||||
type: structure
|
||||
fields:
|
||||
title:
|
||||
label: Titre
|
||||
type: text
|
||||
icon:
|
||||
label: Icône
|
||||
type: text
|
||||
help: Pour trouver votre icône, allez sur <a href="http://fontawesome.io/icons/" target="_blank">http://fontawesome.io/icons/</a>
|
||||
link:
|
||||
label: Lien
|
||||
type: url
|
||||
description:
|
||||
label: Description
|
||||
type: textarea
|
||||
subject:
|
||||
label: Sujet du site web
|
||||
type: textarea
|
||||
keywords:
|
||||
label: Mots Clés
|
||||
type: tags
|
||||
author:
|
||||
label: Auteur·ices
|
||||
type: text
|
||||
sidebar:
|
||||
width: 1/3
|
||||
sections:
|
||||
files:
|
||||
type: files
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
40
public/site/snippets/blocks/image.php
Normal file
40
public/site/snippets/blocks/image.php
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
/** @var \Kirby\Cms\Block $block */
|
||||
$alt = $block->alt();
|
||||
$caption = $block->caption();
|
||||
$link = $block->link();
|
||||
$width = $block->width()->or('100%');
|
||||
$position = $block->position()->or('auto');
|
||||
$src = null;
|
||||
|
||||
if ($block->location() == 'web') {
|
||||
$src = $block->src()->esc();
|
||||
} elseif ($image = $block->image()->toFile()) {
|
||||
$alt = $alt->or($image->alt());
|
||||
$src = $image->url();
|
||||
}
|
||||
|
||||
?>
|
||||
<?php if ($src): ?>
|
||||
<figure style="width:<?= $width ?>; min-width:225px; margin:<?= $position ?>; margin-bottom:1.5em;">
|
||||
<?php if ($link->isNotEmpty()): ?>
|
||||
<a href="<?= Str::esc($link->toUrl()) ?>">
|
||||
<img src="<?= $src ?>" alt="<?= $alt->esc() ?>" loading="lazy">
|
||||
</a>
|
||||
<?php else: ?>
|
||||
<a href="<?= $src ?>" class="glightbox" <?php if($caption->isNotEmpty()):?>
|
||||
data-glightbox="title: <?= $caption ?>"
|
||||
<?php endif?>>
|
||||
<img src="<?= $src ?>" alt="<?= $alt->esc() ?>" loading="lazy">
|
||||
</a>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if ($caption->isNotEmpty()): ?>
|
||||
<figcaption>
|
||||
<?= $caption ?>
|
||||
</figcaption>
|
||||
<?php endif ?>
|
||||
</figure>
|
||||
<?php endif ?>
|
||||
|
||||
40
public/site/snippets/blocks/map.php
Normal file
40
public/site/snippets/blocks/map.php
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
/** @var \Kirby\Cms\Block $block */
|
||||
$alt = $block->alt();
|
||||
$caption = $block->caption();
|
||||
$link = $block->link();
|
||||
$width = $block->width()->or('100%');
|
||||
$position = $block->position()->or('auto');
|
||||
$src = null;
|
||||
|
||||
if ($block->location() == 'web') {
|
||||
$src = $block->src()->esc();
|
||||
} elseif ($image = $block->image()->toFile()) {
|
||||
$alt = $alt->or($image->alt());
|
||||
$src = $image->url();
|
||||
}
|
||||
|
||||
?>
|
||||
<?php if ($src): ?>
|
||||
<figure style="width:<?= $width ?>; min-width:225px; margin:<?= $position ?>; margin-bottom:1.5em;">
|
||||
<?php if ($link->isNotEmpty()): ?>
|
||||
<a href="<?= Str::esc($link->toUrl()) ?>">
|
||||
<img src="<?= $src ?>" alt="<?= $alt->esc() ?>" loading="lazy">
|
||||
</a>
|
||||
<?php else: ?>
|
||||
<a href="<?= $src ?>" class="glightbox" <?php if($caption->isNotEmpty()):?>
|
||||
data-glightbox="title: <?= $caption ?>"
|
||||
<?php endif?>>
|
||||
<img src="<?= $src ?>" alt="<?= $alt->esc() ?>" loading="lazy">
|
||||
</a>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if ($caption->isNotEmpty()): ?>
|
||||
<figcaption>
|
||||
<?= $caption ?>
|
||||
</figcaption>
|
||||
<?php endif ?>
|
||||
</figure>
|
||||
<?php endif ?>
|
||||
|
||||
3
public/site/snippets/blocks/text.php
Normal file
3
public/site/snippets/blocks/text.php
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<?php /** @var \Kirby\Cms\Block $block */ ?>
|
||||
|
||||
<?= $block->text()->kt()->smartypants();?>
|
||||
30
public/site/snippets/blocks/video.php
Normal file
30
public/site/snippets/blocks/video.php
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
use Kirby\Cms\Html;
|
||||
|
||||
/** @var \Kirby\Cms\Block $block */
|
||||
$caption = $block->caption();
|
||||
$url = null;
|
||||
$class = null;
|
||||
|
||||
if ($block->location() == 'web') {
|
||||
$url = $block->url()->esc();
|
||||
$class = "video-from-web";
|
||||
} elseif ($video = $block->video()->toFile()) {
|
||||
$url = $video->url();
|
||||
$class = "video-from-local";
|
||||
}
|
||||
|
||||
?>
|
||||
<?php if ($video = Html::video($url)): ?>
|
||||
<figure class="<?= $class ?>">
|
||||
<?php if ($block->location() == 'web'):?>
|
||||
<?= $video ?>
|
||||
<?php else:?>
|
||||
<video src="<?= $url ?>" controls></video>
|
||||
<?php endif;?>
|
||||
|
||||
<?php if ($caption->isNotEmpty()): ?>
|
||||
<figcaption><?= $caption ?></figcaption>
|
||||
<?php endif ?>
|
||||
</figure>
|
||||
<?php endif ?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue