Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
colintucker committed Jun 26, 2018
2 parents 04b1035 + 31c536d commit 21d2fbe
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Components/SliderComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
namespace SilverWare\Slider\Components;

use SilverStripe\Forms\CheckboxField;
use SilverStripe\Forms\HTMLEditor\HTMLEditorField;
use SilverStripe\Forms\DropdownField;
use SilverStripe\Forms\NumericField;
use SilverStripe\ORM\ArrayList;
Expand Down Expand Up @@ -119,6 +120,7 @@ class SliderComponent extends BaseComponent
* @config
*/
private static $db = [
'IntroContent' => 'HTMLText',
'Mode' => 'Varchar(16)',
'Auto' => 'Boolean',
'Loop' => 'Boolean',
Expand Down Expand Up @@ -239,6 +241,18 @@ public function getCMSFields()

$placeholder = _t(__CLASS__ . '.DROPDOWNDEFAULT', '(default)');

// Create Main Fields:

$fields->addFieldsToTab(
'Root.Main',
[
HTMLEditorField::create(
'IntroContent',
$this->fieldLabel('IntroContent')
)
]
);

// Create Style Fields:

$fields->addFieldsToTab(
Expand Down Expand Up @@ -414,6 +428,7 @@ public function fieldLabels($includerelations = true)
$labels['ColorControl'] = _t(__CLASS__ . '.CONTROLCOLOR', 'Control color');
$labels['HideCaptionsOnMobile'] = _t(__CLASS__ . '.HIDECAPTIONSONMOBILE', 'Hide captions on mobile');
$labels['ThumbMargin'] = _t(__CLASS__ . '.MARGININPX', 'Margin (in pixels)');
$labels['IntroContent'] = _t(__CLASS__ . '.INTROCONTENT', 'Intro content');

// Answer Field Labels:

Expand Down
1 change: 1 addition & 0 deletions templates/SilverWare/Slider/Components/SliderComponent.ss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% include SilverWare\Slider\Components\SliderComponent\Intro %>
<ul $WrapperAttributesHTML>
<% include SilverWare\Slider\Components\SliderComponent\Slides %>
</ul>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<% if $IntroContent %>
<div class="intro">
$IntroContent
</div>
<% end_if %>

0 comments on commit 21d2fbe

Please sign in to comment.