Skip to content
This repository was archived by the owner on Oct 13, 2025. It is now read-only.

Commit 3285763

Browse files
author
Otis Wright
committed
Merge branch 'release/v1.7.0'
2 parents 8955537 + 268f30c commit 3285763

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

_config/config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ SiteTree:
1313
extensions:
1414
- ExtraPageFieldsExtension
1515

16+
SiteConfig:
17+
extensions:
18+
- WebFoxSiteConfig
19+
1620
Image:
1721
extensions:
1822
- ImageExtension

code/WebFoxSiteConfigExtension.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
/**
4+
* Class CustomSiteConfig
5+
*
6+
* @property SiteConfig $owner
7+
*/
8+
class WebFoxSiteConfig extends DataExtension {
9+
10+
static $db = [
11+
'CustomHeaderOutput' => 'Text',
12+
'CustomFooterOutput' => 'Text'
13+
];
14+
15+
static $has_one = [
16+
'PrivacyPolicyPage' => 'SiteTree',
17+
'TermsAndConditionsPage' => 'SiteTree'
18+
];
19+
20+
public function updateCMSFields(FieldList $fields) {
21+
22+
$fields->addFieldsToTab('Root.Main', [
23+
TreeDropdownField::create('PrivacyPolicyPageID', 'Privacy Policy', 'SiteTree'),
24+
TreeDropdownField::create('TermsAndConditionsPageID', 'Terms & Conditions', 'SiteTree')
25+
]);
26+
27+
$fields->addFieldsToTab('Root.Advanced', [
28+
TextareaField::create('CustomHeaderOutput', 'Custom Header Tags'),
29+
TextareaField::create('CustomFooterOutput', 'Custom Footer Tags')
30+
]);
31+
}
32+
}

0 commit comments

Comments
 (0)