I have block definition in cms page
{{block type="divante_cdp/homeblog"}}
And construct method of my block
public function __construct(array $args = array())
{
 $this->setTemplate('page/html/homeblog.phtml');
 $this->addData(array(
 'cache_lifetime' => 3600,
 'cache_tags' => array(Mage_Cms_Model_Block::CACHE_TAG,'tag_home_homeblog'),
 ));
 parent::__construct($args);
}
Block isn't cached. After run below command there is no tag tag_home_homeblog
n98-magerun.phar cache:report -t
What i'm doing wrong? Cache is enabled :)
- 
 2put parent construct above in your constructor instead of put it as last one and then try againRajeev K Tomy– Rajeev K Tomy2014年09月19日 18:07:38 +00:00Commented Sep 19, 2014 at 18:07
1 Answer 1
you need to put your __construct() like this.
public function __construct(array $args = array())
{
 parent::__construct($args);
 $this->setTemplate('page/html/homeblog.phtml');
 $this->addData(array(
 'cache_lifetime' => 3600,
 'cache_tags' => array(Mage_Cms_Model_Block::CACHE_TAG,'tag_home_homeblog'),
 ));
}
Now parent __construct() will not alter the changes that your made in your custom block's __construct() . Thus it makes your __construct() alterations in effect.
Explore related questions
See similar questions with these tags.