Skip to content

Commit

Permalink
NewsArticle.php: CMS fields tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
James Cocker authored and James Cocker committed Apr 14, 2018
1 parent 8983724 commit ad250da
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/Model/NewsArticle.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,11 @@ public function getCMSFields()
$this->beforeUpdateCMSFields(function ($fields) {

$datefield = new DateField('Date', 'Article Date');
// $datefield->setConfig('showcalendar', true);
// $datefield->setConfig('showdropdown', true);
// $datefield->setConfig('dateformat', 'dd/MM/yyyy');

$fields->addFieldToTab('Root.Main', $datefield, 'Content');

$image = new UploadField('AttachedImage', 'Featured Image');
$image->getValidator()->setAllowedExtensions(array('jpg', 'jpeg', 'png', 'gif'));
// $image->setConfig('allowedMaxFileNumber', 1);
$image = UploadField::create('AttachedImage', 'Featured Image');
$image->setAllowedExtensions(array('jpg', 'jpeg', 'png', 'gif'));
$image->setFolderName('Managed/NewsImages');
// $image->setCanPreviewFolder(false);
$image->setDescription("Displayed to the right of the content in the main article, where it can be clicked to enlarge. <br />A thumbnail also appears next to the article summary on the main News page.");
$fields->addFieldToTab('Root.Main', $image, "Content");

Expand Down

0 comments on commit ad250da

Please sign in to comment.