I created a module which is an observer to listen to an event which is triggered on a CMS page and after listening to that disable the cache of the CMS page. My problem is how to have connection between module and CMS page. I have a simple module which I downloaded from smashingmagazin website the structure is like the following:
app\code\local\SmashingMagazine\LogProductUpdate\etc\config.xml
<?xml version="1.0" encoding="UTF-8"?> <config> <modules> <SmashingMagazine_LogProductUpdate> <version>0.0.1</version> </SmashingMagazine_LogProductUpdate> </modules> <global> <models> <smashingmagazine_logproductupdate> <class>SmashingMagazine_LogProductUpdate_Model</class> </smashingmagazine_logproductupdate> </models> <events> I have problem in here: what to write?I know that controller_action_predispatch is an event and it should be dispatched but I don't know if it is the right event to call in config.xml
<controller_action_predispatch> <observers> <page_cms_myid> <class>SmashingMagazine_LogProductUpdate_Model_Observer</class> <method>processPreDispatch</method> </page_cms_myid> </observers> </controller_action_predispatch> </events> </global> </config> app\code\local\SmashingMagazine\LogProductUpdate\Model\observer.php
class SmashingMagazine_LogProductUpdate_Model_Observer { Mage::log("test here"); public function processPreDispatch(Varien_Event_Observer $observer) { $action = $observer->getEvent()->getControllerAction(); // Check to see if $action is a CMScontroller if ($action instanceof Mage_Cms_PageController) { $cache = Mage::app()->getCacheInstance(); // Tell Magento to 'ban' the use of FPC for this request $cache->banUse('full_page'); } } } I want to add this module to the cms page so that the module can be loaded, this module doesn't have any phtml file or a block. do I need to create any? I am doing it because with the help of friend I want to disable cache with this observer page
the module source can be downloaded at here.
I guess maybe I should update the layout of the cms page in design tab it should be something like:
<events> <observers> <page_cms_myid> <class>SmashingMagazine_LogProductUpdate_Model_Observer</class> <method>processPreDispatch</method> </page_cms_myid> </observers> </events> But It doesn't work,also I found these event cheat sheets:

so I changed config.xml again not worked:
<events> <cms_page_prepare_save> <observers> <page_cms_myid> <class>SmashingMagazine_LogProductUpdate_Model_Observer</class> <method>processPreDispatch</method> </page_cms_myid> </observers> </cms_page_prepare_save> </events> I also can have this function to write the dispatch event:
Mage::dispatchEvent('cms_page_prepare_save', array('page' => $model, 'request' => $this->getRequest())); but I don't know where to write it. I know the following Information about my CMS page:
Controller Name:page Action Name:view Route Name:cms Module Name:cms