Skip to content

Commit

Permalink
ensure all elements use holder template from module folder
Browse files Browse the repository at this point in the history
  • Loading branch information
jellygnite committed Mar 26, 2021
1 parent 7506b5d commit 407a349
Show file tree
Hide file tree
Showing 15 changed files with 56 additions and 12 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ Useful elemental building blocks.
* jellygnite/silverstripe-elemental-style ^4.0

## Installation
Add some installation instructions here, having a 1 line composer copy and paste is useful.
Here is a composer command to create a new module project. Ensure you read the
['publishing a module'](https://docs.silverstripe.org/en/developer_guides/extending/how_tos/publish_a_module/) guide
and update your module's composer.json to designate your code as a SilverStripe module.

```
composer require jellygnite/silverstripe-elements
Expand Down
2 changes: 2 additions & 0 deletions _config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ DNADesign\Elemental\Models\BaseElement:
Jellygnite\Elements\Model\BaseElementObject:
extensions:
- Jellygnite\ElementalStyle\Extensions\DynamicStyleExtension
DNADesign\Elemental\Models\ContentElement:
controller_class: Jellygnite\Elements\Controllers\CustomElementController


2 changes: 2 additions & 0 deletions src/Extensions/BaseElementExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Jellygnite\Elements\Extensions;

use Exception;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\ORM\DataExtension;
use DNADesign\Elemental\Models\BaseElement;
use SilverStripe\Dev\Debug;
Expand Down
4 changes: 4 additions & 0 deletions src/Model/ElementAccordion.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Jellygnite\Elements\Model;

use DNADesign\Elemental\Models\BaseElement;
use Jellygnite\Elements\Controllers\CustomElementController;
use Jellygnite\Elements\Model\AccordionObject;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\GridField\GridFieldAddExistingAutocompleter;
Expand Down Expand Up @@ -47,6 +48,9 @@ class ElementAccordion extends BaseElement {
* @var array
*/
private static $styles = [];

// allows us to store templates in this module folder
private static $controller_class = CustomElementController::class;

/**
* @var array
Expand Down
5 changes: 5 additions & 0 deletions src/Model/ElementCarousel.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Jellygnite\Elements\Model;

use DNADesign\Elemental\Models\BaseElement;
use Jellygnite\Elements\Controllers\CustomElementController;
use Jellygnite\Elements\Model\BaseElementObject;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\GridField\GridFieldAddExistingAutocompleter;
Expand Down Expand Up @@ -48,6 +49,10 @@ class ElementCarousel extends BaseElement {
*/
private static $styles = [];

// allows us to store templates in this module folder
private static $controller_class = CustomElementController::class;


/**
* @var array
*/
Expand Down
5 changes: 3 additions & 2 deletions src/Model/ElementFeature.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ElementFeature extends BaseElement
private static $table_name = 'ElementFeature';

private static $styles = [];

private static $extra_styles = [
'ImageOrder' => [
'Title' => 'Image Stacking',
Expand All @@ -63,7 +63,8 @@ class ElementFeature extends BaseElement
],
];

private static $controller_class = CustomElementController::class; // allows us to store templates in this module folder
// allows us to store templates in this module folder
private static $controller_class = CustomElementController::class;

private static $controller_template = "ElementHolder";

Expand Down
5 changes: 5 additions & 0 deletions src/Model/ElementFileList.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Colymba\BulkUpload\BulkUploader;
use DNADesign\Elemental\Models\BaseElement;
use Jellygnite\Elements\Controllers\CustomElementController;
use Jellygnite\Elements\Model\FileListObject;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\GridField\GridFieldAddExistingAutocompleter;
Expand Down Expand Up @@ -42,6 +43,10 @@ class ElementFileList extends BaseElement
*/
private static $inline_editable = false;


// allows us to store templates in this module folder
private static $controller_class = CustomElementController::class;

/**
* @param bool $includerelations
* @return array
Expand Down
5 changes: 5 additions & 0 deletions src/Model/ElementGallery.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Jellygnite\Elements\Model;

use DNADesign\Elemental\Models\BaseElement;
use Jellygnite\Elements\Controllers\CustomElementController;
use Jellygnite\Elements\Model\GalleryObject;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\LiteralField;
Expand Down Expand Up @@ -51,6 +52,10 @@ class ElementGallery extends BaseElement {
* @var array
*/
private static $styles = [];

// allows us to store templates in this module folder
private static $controller_class = CustomElementController::class;


/**
* @var array
Expand Down
5 changes: 5 additions & 0 deletions src/Model/ElementImageGallery.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Jellygnite\Elements\Model;

use DNADesign\Elemental\Models\BaseElement;
use Jellygnite\Elements\Controllers\CustomElementController;
use SilverStripe\Assets\Image;
use SilverStripe\Forms\FieldList;
use SilverStripe\ORM\FieldType\DBField;
Expand Down Expand Up @@ -48,6 +49,10 @@ class ElementImageGallery extends BaseElement {
* @var array
*/
private static $styles = [];

// allows us to store templates in this module folder
private static $controller_class = CustomElementController::class;


/**
* @var array
Expand Down
5 changes: 5 additions & 0 deletions src/Model/ElementLinks.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Jellygnite\Elements\Model;

use DNADesign\Elemental\Models\BaseElement;
use Jellygnite\Elements\Controllers\CustomElementController;
use Sheadawson\Linkable\Models\Link;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\LiteralField;
Expand Down Expand Up @@ -53,6 +54,10 @@ class ElementLinks extends BaseElement {
* @var array
*/
private static $styles = [];

// allows us to store templates in this module folder
private static $controller_class = CustomElementController::class;


/**
* @var array
Expand Down
5 changes: 5 additions & 0 deletions src/Model/ElementPersons.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Jellygnite\Elements\Model;

use DNADesign\Elemental\Models\BaseElement;
use Jellygnite\Elements\Controllers\CustomElementController;
use Jellygnite\Elements\Model\PersonObject;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\GridField\GridFieldAddExistingAutocompleter;
Expand Down Expand Up @@ -47,6 +48,10 @@ class ElementPersons extends BaseElement {
* @var array
*/
private static $styles = [];

// allows us to store templates in this module folder
private static $controller_class = CustomElementController::class;


/**
* @var array
Expand Down
4 changes: 3 additions & 1 deletion src/Model/ElementPopups.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,16 @@ class ElementPopups extends BaseElement {
*/
private static $table_name = 'ElementPopups';

private static $controller_class = CustomElementController::class; // allows us to store templates in this module folder

private static $controller_template = 'ElementHolder_Popups';

/**
* @var array
*/
private static $styles = [];

// allows us to store templates in this module folder
private static $controller_class = CustomElementController::class;

/**
* @var array
Expand Down
8 changes: 5 additions & 3 deletions src/Model/ElementPromos.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,16 @@ class ElementPromos extends BaseElement {
*/
private static $table_name = 'ElementPromos';

private static $controller_class = CustomElementController::class; // allows us to store templates in this module folder

private static $controller_template = 'ElementHolder';

/**
* @var array
*/
private static $styles = [];

// allows us to store templates in this module folder
private static $controller_class = CustomElementController::class;

private static $controller_template = 'ElementHolder';

/**
* @var array
Expand Down
5 changes: 5 additions & 0 deletions src/Model/ElementSponsors.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Jellygnite\Elements\Model;

use DNADesign\Elemental\Models\BaseElement;
use Jellygnite\Elements\Controllers\CustomElementController;
use Jellygnite\Elements\Model\SponsorObject;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\GridField\GridFieldAddExistingAutocompleter;
Expand Down Expand Up @@ -48,6 +49,10 @@ class ElementSponsors extends BaseElement {
*/
private static $styles = [];

// allows us to store templates in this module folder
private static $controller_class = CustomElementController::class;


/**
* @var array
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Model/GalleryObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public function getEmbedURL($params = null) {
return 'https://player.vimeo.com/video/'.$this->Code;
break;
default:
return false;
return $this->VideoURL;
}
}

Expand Down Expand Up @@ -278,7 +278,7 @@ public function getMediaType($params = null) {
return 'video';
break;
default:
return false;
return 'video';
}
break;
}
Expand Down

0 comments on commit 407a349

Please sign in to comment.