2015-06-17 29 views
-1

我已經使用product_link核心部件構建了自己的小部件。Magento部件變量

{{widget type="brandpage_header_b/Header" brand_header_logo="wysiwyg/myimage.png" brand_header_img="wysiwyg/bmyimage.jpg" brand_header_title="titel" brand_header_text="text" template="path/to/template.phtml"}} 

現在我想調用template.phtml中的一些變量。

我想:

<?php $brand_header_logo = $this->getData('category_id'); 
echo $brand_header_logo; 
?> 

但是,這並不工作。任何人都可以解釋我如何將Widget-Variables加入到.phtml模板中嗎? Appriciate你的幫助了很多!

回答

2

我不太瞭解你的邏輯。如果你想從你的Widget聲明中獲得brand_header_logo變量,那麼在getData方法中使用它。

<?php $brand_header_logo = $this->getData('brand_header_logo'); 
echo $brand_header_logo; 
?> 

但現在你正在試圖獲得CATEGORY_ID,你不要在你的widget有。

+0

也許我昨天很累... – ScubaBen