ajout de la methode allTexts() dans site\models\year.php
This commit is contained in:
parent
344af4c0fe
commit
dee8f94182
2 changed files with 10 additions and 1 deletions
8
site/models/year.php
Normal file
8
site/models/year.php
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?php
|
||||||
|
class YearPage extends Page{
|
||||||
|
public function allTexts(){
|
||||||
|
$texts = $this->children()->listed();
|
||||||
|
$linked = $this->linkedTexts()->toPages();
|
||||||
|
return $texts->merge($linked);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -18,7 +18,8 @@
|
||||||
class="see-more toggle-btn toggle-btn--left" @click="edito = !edito">Lire</button>
|
class="see-more toggle-btn toggle-btn--left" @click="edito = !edito">Lire</button>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<ul class="panel-item-content__texts texts">
|
<ul class="panel-item-content__texts texts">
|
||||||
<?php foreach($section->children() as $article): ?>
|
<?php $articles = method_exists($section, 'allTexts') ? $section->allTexts() : $section->children(); ?>
|
||||||
|
<?php foreach($articles as $article): ?>
|
||||||
<?php
|
<?php
|
||||||
$author = $article->author()->toPage() == null ? 'inconnu' : $article->author()->toPage()->title();
|
$author = $article->author()->toPage() == null ? 'inconnu' : $article->author()->toPage()->title();
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue