Updating the Layout from the Observer

stenring

New Member
I am workin on a slider block Magento, and I am trying to genreate and update my Layout from the Observer :\[quote\] Event: controller_action_layout_load_before\[/quote\]This my Observer Method : \[code\] $myXml="<".$page.">"; $myXml.='<reference name="'.$posH.'">'; $myXml.='<block type="sliderboard/slider" name="sliderboard" '.$posV.'="-" template="sliderboard/myview.phtml"/>'; $myXml.='</reference>'; $myXml.="</".$page.">"; $layout = $observer->getEvent()->getLayout(); $layout=Mage::getSingleton('core/layout'); //Zend_Debug::dump($myXml); die(); $layout->getUpdate()->addUpdate($myXml); $layout->getUpdate()->load(); $layout->generateXml(); $layout->generateBlocks();\[/code\]the fact is, this what i get from the "$myXML" variable : \[code\]<cms_page><reference name="content"><block type="sliderboard/slider" name="sliderboard" after="-" template="sliderboard/myview.phtml"/></reference></cms_page>\[/code\]And It doesn't work !! but whene I have tried to copy/past this xml in my layout it works ! the Xml code is correct!I Need Help
Thanks !
 
Back
Top