Skip to content

Commit

Permalink
Fixes #32
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabrizio Branca committed Mar 25, 2015
1 parent e546c67 commit 553af28
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/code/community/Aoe/TemplateHints/Model/Observer.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ class Aoe_TemplateHints_Model_Observer {
*/
protected $init = true;

/**
* @var bool
*/
protected $afterHead = false;

/**
* @var int
*/
Expand Down Expand Up @@ -92,11 +97,15 @@ public function core_block_abstract_to_html_after(Varien_Event_Observer $params)
$block = $params->getBlock(); /* @var $block Mage_Core_Block_Abstract */

// will only be called once and allows renderes to initialize themselves (e.g. adding js/css)
if ($this->init && !Mage::getStoreConfigFlag('advanced/modules_disable_output/' . $block->getModuleName()) && $block->getNameInLayout()) {
if ($this->init && $this->afterHead && !Mage::getStoreConfigFlag('advanced/modules_disable_output/' . $block->getModuleName()) && $block->getNameInLayout()) {
$wrappedHtml = '<!-- INIT AOE_TEMPLATEHINTS RENDERER START -->' . $this->getRenderer()->init($wrappedHtml) . '<!-- INIT AOE_TEMPLATEHINTS RENDERER STOP -->';
$this->init = false;
}

if ($block->getNameInLayout() == 'head') {
$this->afterHead = true;
}

$transport = $params->getTransport();

$this->hintId++;
Expand Down

0 comments on commit 553af28

Please sign in to comment.