KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm trying to set a variable in my local.xml file for my custom block: <layout> <!-- ... --> <page_homepage> <!-- ... --> <reference name="root"> <!-- ... --> <block type="core/template" name="home_page_sections" template="page/homepage/sections.phtml"> <block type="layout/carousel" name="featured_carousel"> <action method="setData"> <name>filter_attribute</name> <value>is_featured_product</value> </action> </block> </block> </reference> </page_homepage> </layout> But I am not getting the data on the other end in my controller: class Foo_Layout_Block_Carousel extends Mage_Core_Block_Template { public function __construct() { parent::__construct(); $filterAttribute = $this->getFilterAttribute(); // Nothing $filterAttribute = $this->getData('filter_attribute'); // Nada // Alright, fine, what DO I have?! var_dump($this->getData()); // array(0) {} ... Argh! } } From all my searching I've found that this really should work, but since it does not, I have a feeling I'm missing something obvious. Here is my layout module's configuration (I'm using a single module to define a homepage and any other blocks I need for the site): <?xml version="1.0"?> <config> <modules> <Foo_Layout> <version>0.1.0</version> </Foo_Layout> </modules> <global> <page> <layouts> <foo_homepage translate="label"> <label>Homepage</label> <template>
Tags (comma-separated)
Save Edits
Cancel