fix category page
This commit is contained in:
parent
18db74998d
commit
a1d945a8ab
5 changed files with 51 additions and 69 deletions
|
|
@ -1,23 +0,0 @@
|
|||
<?php
|
||||
|
||||
use Kirby\Cms\Pages;
|
||||
use Kirby\Cms\Page;
|
||||
use Kirby\Uuid\Uuid;
|
||||
|
||||
class CategoryPage extends Page
|
||||
{
|
||||
public function children(): Pages
|
||||
{
|
||||
$category = $this->title()->value();
|
||||
$allTexts = page("textes")->grandChildren();
|
||||
$textsInCategory = $allTexts->filterBy('category', $category);
|
||||
|
||||
$children = new Pages();
|
||||
|
||||
foreach ($textsInCategory as $text) {
|
||||
$children->add($text);
|
||||
}
|
||||
|
||||
return $children;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue