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 27, 2021
1 parent 407a349 commit 5c874e5
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
5 changes: 3 additions & 2 deletions _config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ DNADesign\Elemental\Models\BaseElement:
Jellygnite\Elements\Model\BaseElementObject:
extensions:
- Jellygnite\ElementalStyle\Extensions\DynamicStyleExtension
DNADesign\Elemental\Models\ContentElement:
controller_class: Jellygnite\Elements\Controllers\CustomElementController
DNADesign\Elemental\Models\ElementContent:
extensions:
- Jellygnite\Elements\Extensions\ElementContentExtension


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

namespace Jellygnite\Elements\Extensions;

use Jellygnite\Elements\Controllers\CustomElementController;
use Exception;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\ORM\DataExtension;
Expand All @@ -11,6 +12,11 @@
class BaseElementExtension extends DataExtension
{

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

private static $controller_template = 'ElementHolder';


public function getNextElement(){
$element = BaseElement::get()->filter([
'ParentID' => $this->owner->ParentID,
Expand Down
17 changes: 17 additions & 0 deletions src/Extensions/ElementContentExtension.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Jellygnite\Elements\Extensions;

use Jellygnite\Elements\Controllers\CustomElementController;
use SilverStripe\ORM\DataExtension;


class ElementContentExtension extends DataExtension
{

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

private static $controller_template = 'ElementHolder';


}

0 comments on commit 5c874e5

Please sign in to comment.