-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #677 from biglotteryfund/climate-action-fund
Key initiatives section created
- Loading branch information
Showing
4 changed files
with
140 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
config/project/entryTypes/contentPage--ec297084-dce1-40ff-8b18-e89af75b853c.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
fieldLayouts: | ||
e80349e0-75c6-4245-80cd-e4bf4d9f2b4b: | ||
tabs: | ||
- | ||
elements: | ||
- | ||
autocapitalize: true | ||
autocomplete: false | ||
autocorrect: true | ||
class: null | ||
disabled: false | ||
id: null | ||
instructions: null | ||
label: null | ||
max: null | ||
min: null | ||
name: null | ||
orientation: null | ||
placeholder: null | ||
readonly: false | ||
requirable: false | ||
size: null | ||
step: null | ||
tip: null | ||
title: null | ||
type: craft\fieldlayoutelements\EntryTitleField | ||
warning: null | ||
width: 100 | ||
- | ||
fieldUid: 1620ec3b-4d1d-4929-bd17-68cf9f224a53 | ||
instructions: '' | ||
label: '' | ||
required: '1' | ||
tip: null | ||
type: craft\fieldlayoutelements\CustomField | ||
warning: null | ||
width: 100 | ||
- | ||
fieldUid: 40755bc8-380a-49b7-9f5b-786c5e1e6bbe | ||
instructions: '' | ||
label: '' | ||
required: '' | ||
tip: null | ||
type: craft\fieldlayoutelements\CustomField | ||
warning: null | ||
width: 100 | ||
name: Content | ||
sortOrder: 1 | ||
handle: contentPage | ||
hasTitleField: true | ||
name: 'Content Page' | ||
section: 0be940dc-4e56-43bb-909f-910e8a7a287e | ||
sortOrder: 1 | ||
titleFormat: null | ||
titleTranslationKeyFormat: null | ||
titleTranslationMethod: site |
31 changes: 31 additions & 0 deletions
31
config/project/sections/keyInitiatives--0be940dc-4e56-43bb-909f-910e8a7a287e.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
enableVersioning: true | ||
handle: keyInitiatives | ||
name: 'Key initiatives' | ||
previewTargets: | ||
- | ||
__assoc__: | ||
- | ||
- label | ||
- 'Primary entry page' | ||
- | ||
- urlFormat | ||
- '{url}' | ||
- | ||
- refresh | ||
- '1' | ||
propagationMethod: all | ||
siteSettings: | ||
81de1ac6-1a0b-40e6-b99c-42b99e5dc777: | ||
enabledByDefault: true | ||
hasUrls: true | ||
template: null | ||
uriFormat: '{parent.uri ? parent.uri : ''key-initiatives''}/{slug}' | ||
d0635f95-a563-4f66-9195-33da0eb644d5: | ||
enabledByDefault: true | ||
hasUrls: true | ||
template: null | ||
uriFormat: '{parent.uri ? parent.uri : ''key-initiatives''}/{slug}' | ||
structure: | ||
maxLevels: null | ||
uid: baa873bc-41df-4153-997f-cc269b6e350a | ||
type: structure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace Biglotteryfund; | ||
|
||
use Biglotteryfund\EntryHelpers; | ||
use Biglotteryfund\Images; | ||
use craft\elements\Entry; | ||
use League\Fractal\TransformerAbstract; | ||
|
||
class KeyInitiatives extends TransformerAbstract | ||
{ | ||
public function __construct($locale) | ||
{ | ||
$this->locale = $locale; | ||
} | ||
|
||
public function transform(Entry $entry) | ||
{ | ||
$commonFields = ContentHelpers::getCommonFields($entry, $this->locale); | ||
|
||
if ($entry->type->handle === 'contentPage') { | ||
return ContentHelpers::getFlexibleContentPage($entry, $this->locale); | ||
} | ||
|
||
} | ||
} |