Skip to content

Commit

Permalink
Merge branch 'release/v1.7.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Otis Wright committed Jun 20, 2016
2 parents 8955537 + 268f30c commit 3285763
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
4 changes: 4 additions & 0 deletions _config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ SiteTree:
extensions:
- ExtraPageFieldsExtension

SiteConfig:
extensions:
- WebFoxSiteConfig

Image:
extensions:
- ImageExtension
Expand Down
32 changes: 32 additions & 0 deletions code/WebFoxSiteConfigExtension.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

/**
* Class CustomSiteConfig
*
* @property SiteConfig $owner
*/
class WebFoxSiteConfig extends DataExtension {

static $db = [
'CustomHeaderOutput' => 'Text',
'CustomFooterOutput' => 'Text'
];

static $has_one = [
'PrivacyPolicyPage' => 'SiteTree',
'TermsAndConditionsPage' => 'SiteTree'
];

public function updateCMSFields(FieldList $fields) {

$fields->addFieldsToTab('Root.Main', [
TreeDropdownField::create('PrivacyPolicyPageID', 'Privacy Policy', 'SiteTree'),
TreeDropdownField::create('TermsAndConditionsPageID', 'Terms & Conditions', 'SiteTree')
]);

$fields->addFieldsToTab('Root.Advanced', [
TextareaField::create('CustomHeaderOutput', 'Custom Header Tags'),
TextareaField::create('CustomFooterOutput', 'Custom Footer Tags')
]);
}
}

0 comments on commit 3285763

Please sign in to comment.