Skip to content

Commit

Permalink
Added support for be_wildcard template (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
qzminski authored and ausi committed Jul 24, 2019
1 parent 2ffd50e commit 3e9a435
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/Element/CustomElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
namespace MadeYourDay\RockSolidCustomElements\Element;

use Contao\Image\PictureConfigurationInterface;
use Contao\ModuleModel;
use MadeYourDay\RockSolidColumns\Element\ColumnsStart;
use MadeYourDay\RockSolidCustomElements\Template\CustomTemplate;
use MadeYourDay\RockSolidCustomElements\CustomElements;
use Patchwork\Utf8;

/**
* Custom content element and frontend module
Expand Down Expand Up @@ -93,7 +95,27 @@ public function rsceGetBackendOutput()
}

if (!empty($config['beTemplate'])) {

if (!isset($this->arrData['wildcard'])) {
$label = CustomElements::getLabelTranslated($config['label']);
$this->arrData['wildcard'] = '### ' . Utf8::strtoupper(is_array($label) ? $label[0] : $label) . ' ###';
}

if (!isset($this->arrData['title'])) {
$this->arrData['title'] = $this->headline;
}

if (
!isset($this->arrData['link'])
&& !isset($this->arrData['href'])
&& $this->objModel instanceof ModuleModel
) {
$this->arrData['link'] = $this->name;
$this->arrData['href'] = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id;
}

$this->strTemplate = $config['beTemplate'];

return null;
}

Expand Down

0 comments on commit 3e9a435

Please sign in to comment.