Skip to content

Commit

Permalink
Fix bugs with the markup mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
nilov committed Feb 6, 2017
1 parent 1157a69 commit 3782e55
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/Extension/CmsTwigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ public function getJson($url)
*/
public function content($category, $blockName, $default = null)
{
if ($this->markupMode) {
return $default;
}

$contentBlockService = $this->contentBlockService;

return $contentBlockService->getContentBlock($category, $blockName, $default);
Expand All @@ -160,6 +164,10 @@ public function content($category, $blockName, $default = null)
*/
public function editable($category, $blockName)
{
if ($this->markupMode) {
return '';
}

$contentBlockService = $this->contentBlockService;

if ($this->isEditable()) {
Expand All @@ -177,6 +185,10 @@ public function editable($category, $blockName)
*/
public function editableObject($id)
{
if ($this->markupMode) {
return '';
}

$compositeObjectService = $this->compositeObjectService;

if ($this->isEditable()) {
Expand All @@ -196,6 +208,10 @@ public function editableObject($id)
*/
public function option($category, $optionName, $default = null)
{
if ($this->markupMode) {
return $default;
}

$optionService = $this->optionService;

return $optionService->getOption($category, $optionName, $default);
Expand Down

0 comments on commit 3782e55

Please sign in to comment.