Skip to content

Commit

Permalink
ss 5 updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jellygnite committed Nov 14, 2024
1 parent 689f37a commit 32c645b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Model/BaseElementObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ class BaseElementObject extends DataObject
'SubTitle' => 'Varchar(255)',
'Content' => 'HTMLText',
'ExtraClass' => 'Varchar(255)',
'Style' => 'Varchar(255)'
'Style' => 'Varchar(255)',
'ShowButton' => 'Boolean'
);

/**
Expand All @@ -76,6 +77,10 @@ class BaseElementObject extends DataObject
* @var string
*/
private static $default_sort = 'Title ASC';

private static $defaults = array (
'ShowButton' => '0'
);

/**
* @var array
Expand Down Expand Up @@ -165,6 +170,11 @@ public function getCMSFields()
$fields->dataFieldByName('ElementLinkID')
);

$fields->insertBefore(
'Content',
$fields->dataFieldByName('ShowButton')
);

$image = $fields->dataFieldByName('Image')
->setDescription(_t(__CLASS__.'.ImageDescription', 'Optional. Display an image.'))
->setFolderName('images')
Expand Down
4 changes: 4 additions & 0 deletions src/Model/ElementFeature.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ public function getCMSFields()
LinkField::create('ElementLinkID', $this->fieldLabel('ElementLinkID'))
->setDescription(_t(__CLASS__.'.LinkDescription', 'Optional. Add a call to action link.'))
);

$fields->dataFieldByName('Content')
->setRows(6);

$fields->dataFieldByName('Image')
->setFolderName('images')
->setAllowedFileCategories('image/supported','image/unsupported');
Expand Down

0 comments on commit 32c645b

Please sign in to comment.