I have a module which adds little piiece of code to specified static blocks – meaning that there are 2 filters:
- static blocks only
- only some of them, which are specified.
Currently I have an observer, which catches abstract_html_after event and checkes whether this is a static block at all and whether this block is in specified block list. If so then it adds this little html addon to the block.
The problem is: this algorythm slows down system horrifically.
What might be the solutions?
Currently there is no CMS block specific event you can use that narrows down your event scope.
You can’t even use the
cms_block_load_afterevent on the cms/block model to do that, because inMage_Cms_Model_Blockno$_eventPrefixis set, so you are stuck withcore_abstract_load_after.The only solution is to rewrite the cms/block block or model class and either dispatch a custom event there, or just add your content directly in the rewritten class.