add client brief page
This commit is contained in:
parent
83cf6beea7
commit
769639b241
12 changed files with 97 additions and 53 deletions
|
|
@ -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'];
|
||||
|
|
|
|||
9
public/site/templates/client-brief.json.php
Normal file
9
public/site/templates/client-brief.json.php
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
|
||||
$specificData = [
|
||||
"exampleField" => $page->exampleField(),
|
||||
];
|
||||
|
||||
$data = array_merge($genericData, $specificData);
|
||||
|
||||
echo json_encode($data);
|
||||
1
public/site/templates/client-brief.php
Normal file
1
public/site/templates/client-brief.php
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?php snippet('generic-template') ?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue