Skip to content

Commit

Permalink
Merge pull request #69 from Samuell1/develop
Browse files Browse the repository at this point in the history
Merge develop
  • Loading branch information
Samuell1 authored Oct 5, 2018
2 parents 0441bbd + cc0a888 commit f665cbe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/ContentEditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
class ContentEditor extends ComponentBase
{
public $content;
public $defaultFile;
public $file;
public $fixture;
public $tools;
Expand Down Expand Up @@ -76,6 +77,7 @@ public function onRender()
$this->additional_styles = Settings::renderCss();
$this->renderCount = $this->page['renderCount'] += 1;

$this->defaultFile = $this->property('file');
$this->file = $this->setFile($this->property('file'));
$this->fixture = $this->property('fixture');
$this->tools = $this->property('tools');
Expand Down Expand Up @@ -113,9 +115,11 @@ public function onSave()

public function getFile()
{
// if no locale file exists -> render the default, without language suffix

if (Content::load($this->getTheme(), $this->file)) {
return $this->renderContent($this->file);
} else if (Content::load($this->getTheme(), $this->defaultFile)) { // if no locale file exists -> render the default, without language suffix
return $this->renderContent($this->defaultFile);
}

return '';
Expand Down
4 changes: 4 additions & 0 deletions updates/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@
- Fix renderCount if component using other alias name
1.2.1:
- Fix render __SELF__.class in component partials
1.2.2:
- Handle various storage paths for images
1.2.3:
- Load default file if language file does not exists

0 comments on commit f665cbe

Please sign in to comment.