add client brief page

This commit is contained in:
isUnknown 2024-09-26 19:14:20 +02:00
parent 83cf6beea7
commit 769639b241
12 changed files with 97 additions and 53 deletions

View file

@ -2,14 +2,17 @@
class ProjectPage extends Page {
public function getSteps() {
$steps = [];
$steps = array_map(function($child) {
return [
'text' => $child['content']['title'],
'value' => $child['content']['stepname'],
'index' => $child['content']['stepindex']
foreach ($this->children() as $child) {
$steps[] = [
'text' => $child->title()->value(),
'value' => $child->stepName()->value(),
'index' => $child->stepIndex()->value(),
'modified' => $child->modified('Y-MM-dd'),
'uri' => $child->uri()
];
}, $this->children()->toArray());
}
usort($steps, function ($a, $b) {
return $a['index'] <=> $b['index'];

View file

@ -0,0 +1,9 @@
<?php
$specificData = [
"exampleField" => $page->exampleField(),
];
$data = array_merge($genericData, $specificData);
echo json_encode($data);

View file

@ -0,0 +1 @@
<?php snippet('generic-template') ?>