create body reusable field
This commit is contained in:
parent
1b62fa7589
commit
9b1aeb5cd0
15 changed files with 143 additions and 147 deletions
8
site/blueprints/fields/body.yml
Normal file
8
site/blueprints/fields/body.yml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
label: Corps
|
||||
type: writer
|
||||
headings:
|
||||
- 3
|
||||
marks:
|
||||
- bold
|
||||
- italic
|
||||
- link
|
||||
|
|
@ -9,8 +9,7 @@ tabs:
|
|||
type: fields
|
||||
fields:
|
||||
presentation:
|
||||
label: Présentation
|
||||
type: writer
|
||||
extends: fields/body
|
||||
help: Optionnelle
|
||||
texts:
|
||||
label: Textes
|
||||
|
|
|
|||
|
|
@ -15,6 +15,4 @@ tabs:
|
|||
label: Corps
|
||||
type: fields
|
||||
fields:
|
||||
body:
|
||||
label: Corps
|
||||
type: writer
|
||||
body: fields/body
|
||||
|
|
|
|||
|
|
@ -17,8 +17,6 @@ tabs:
|
|||
fields:
|
||||
chapo:
|
||||
label: Chapo
|
||||
type: writer
|
||||
body:
|
||||
label: Corps
|
||||
type: writer
|
||||
metaTab: tabs/meta
|
||||
extends: fields/body
|
||||
body: fields/body
|
||||
metaTab: tabs/meta
|
||||
|
|
|
|||
|
|
@ -6,8 +6,7 @@ tabs:
|
|||
- width: 1/1
|
||||
fields:
|
||||
body:
|
||||
label: Texte
|
||||
type: writer
|
||||
extends: fields/body
|
||||
- width: 1/2
|
||||
fields:
|
||||
subscribers:
|
||||
|
|
|
|||
|
|
@ -9,6 +9,4 @@ tabs:
|
|||
type: writer
|
||||
nodes: false
|
||||
marks: false
|
||||
edito:
|
||||
label: Éditorial
|
||||
type: writer
|
||||
edito: fields/body
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ $isOpen = isset($isOpen) ? $isOpen : false;
|
|||
class="page-cover"
|
||||
>
|
||||
<div class="title-wrapper">
|
||||
<a href="#main-content" class="no-underline">
|
||||
<a href="#main-content" class="no-underline" class="voir le texte">
|
||||
<?= $slots->title() ?>
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
<footer id="main-footer">
|
||||
<ul id="links">
|
||||
<?php if (!$page->isHomePage()): ?>
|
||||
<li>
|
||||
<button class="plus open-nav" title="chercher parmi les textes">textes</button>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<?php if ($page->is(page('inscription'))): ?>
|
||||
<li>
|
||||
<a href="<?= $site->url() ?>">
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<h2 class="main-title <?= setTitleFontSizeClass($page->title()) ?>"><?= $page->title() ?></h2>
|
||||
<ul class="texts">
|
||||
<?php foreach($kirby->collection('categories') as $category): ?>
|
||||
<?php if ($category['title'] == $page->title()->value()): ?>
|
||||
<?php if ($category->title() == $page->title()): ?>
|
||||
<?php foreach($category['texts'] as $article): ?>
|
||||
<li
|
||||
class="text"
|
||||
|
|
|
|||
|
|
@ -1,19 +1,12 @@
|
|||
<?php snippet('header') ?>
|
||||
<main id="<?= $page->template() ?>">
|
||||
<div id="entry-btns">
|
||||
<button
|
||||
class="entry-btn entry-btn--left toggle-btn toggle-btn--left"
|
||||
onclick="togglePanel('left')"
|
||||
>années</button>
|
||||
<button
|
||||
class="entry-btn entry-btn--right toggle-btn toggle-btn--right"
|
||||
onclick="togglePanel('right')"
|
||||
>categories</button>
|
||||
</div>
|
||||
<article>
|
||||
<div id="main-content">
|
||||
<?php snippet('cover', array('isOpen' => true), slots: true) ?>
|
||||
<?php slot('title') ?>
|
||||
<h2 class="main-title <?= setTitleFontSizeClass($page->title()) ?>"><?= $page->title() ?></h2>
|
||||
<?= $page->body() ?>
|
||||
</div>
|
||||
<?php endslot() ?>
|
||||
<?php endsnippet() ?>
|
||||
</article>
|
||||
</main>
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
<span class="light">par</span>
|
||||
<a class="author" href="/auteurs/<?= Str::slug($page->author()->toPage()->title()) ?>"><?= $page->author()->toPage()->title() ?></a><br>
|
||||
<span class="light">publié le </span><?= $page->published()->toDate('d/m/Y') ?><br>
|
||||
<span class="light">dans</span> <a href="<?= $page->parent()->url() ?>"><?= $page->parent()->title() ?></a> / <a href="/categories/<?= $page->category() ?>"><?= $page->category() ?></a>
|
||||
<span class="light">dans</span> <a href="<?= $page->parent()->url() ?>" title="voir les textes liés à l'année <?= $page->parent()->title() ?>"><?= $page->parent()->title() ?></a> / <a href="/categories/<?= $page->category() ?>" title="voir les textes de la catégorie <?= $page->category() ?>"><?= $page->category() ?></a>
|
||||
</p>
|
||||
<?php endslot() ?>
|
||||
<?php endsnippet() ?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue